public static List < String > metaNamespaceIndexFunc ( Object obj ) { try { V1ObjectMeta metadata = Reflect . objectMetadata ( obj ) ; if ( metadata == null ) { return Collections . emptyList ( ) ; } return Collections . singletonList ( metadata . getNamespace ( ) ) ; } catch ( ObjectMetaReflectException e ) { // NOTE(yue9944882): might want to handle this as a checked exception throw new RuntimeException ( e ) ; } }
metaNamespaceIndexFunc is a default index function that indexes based on an object s namespace .