0

I am working in Cloudera Manager Navigator REST API where extracting result is working fine, but unable to get any nested value.

The type of data is extracting as below.

{
    "parentPath": "String",
    "customProperties": "Map[string,string]",
    "sourceType": "String",
    "entityType": "String"
}

And data should be like

{
    "parentPath": "abcd",
    "customProperties": {
                            "nameservice" : "xyz"
                        },
    "sourceType": "rcs",
    "entityType": "ufo"
}

But I am getting key-value result as follows.

parentPath :abcd
customProperties : null
sourceType : rcs
entityType : ufo

In above response data, "customProperties" is coming with a null value where it should return a map object contains ["nameservice" : "xyz"]. This is the problem with following code snippet.

MetadataResultSet metadataResultSet = extractor.extractMetadata(null, null,"sourceType:HDFS", "identity:*");
Iterator<Map<String, Object>> entitiesIt = metadataResultSet.getEntities().iterator(); 
     while(entitiesIt.hasNext()){
        Map<String, Object> result = entitiesIt.next();
        for(String data : result.keySet()){
                        System.out.println(" key:"+data+" value:"+result.get(data));
                        }
        }

Can you suggest me how to get the nested value where datatype is complex.

tk421
  • 5,775
  • 6
  • 23
  • 34
abhijit nag
  • 451
  • 6
  • 24

1 Answers1

0

have u checked how the data looks on navigator ui? You can first verify that once, and also try cloudera /entities/entity-id rest API in browser to check how json response is coming

Manohar CS
  • 31
  • 8
  • Navigator UI doesn't contain all those details data and "https://abcd:7777/api/v9/actions/running" is returning []. But JSON response against (/entities/entity-id) is coming with proper data. I also don't have any problem in my java code during extraction of simple data, only complex type("customProperties" as mentioned above) is returning null values. – abhijit nag Jul 12 '16 at 10:01