HDFS-12037. Ozone: Improvement rest API output format for better looking. Contributed by Weiwei Yang.

This commit is contained in:
Weiwei Yang 2017-07-08 10:06:58 +08:00 committed by Owen O'Malley
parent 25c1b296e6
commit 7afddca9d5
6 changed files with 12 additions and 6 deletions

View File

@ -56,7 +56,8 @@ public class BucketInfo implements Comparable<BucketInfo> {
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
mapper.addMixIn(Object.class, MixIn.class);
WRITER = mapper.writer(filters);
mapper.setFilterProvider(filters);
WRITER = mapper.writerWithDefaultPrettyPrinter();
}
private String volumeName;

View File

@ -54,7 +54,8 @@ public class KeyInfo implements Comparable<KeyInfo> {
JsonAutoDetect.Visibility.ANY);
mapper.addMixIn(Object.class, MixIn.class);
WRITER = mapper.writer(filters);
mapper.setFilterProvider(filters);
WRITER = mapper.writerWithDefaultPrettyPrinter();
}
/**

View File

@ -55,7 +55,8 @@ public class ListBuckets {
JsonAutoDetect.Visibility.ANY);
mapper.addMixIn(Object.class, MixIn.class);
WRITER = mapper.writer(filters);
mapper.setFilterProvider(filters);
WRITER = mapper.writerWithDefaultPrettyPrinter();
}
private List<BucketInfo> buckets;

View File

@ -58,7 +58,8 @@ public class ListKeys {
JsonAutoDetect.Visibility.ANY);
mapper.addMixIn(Object.class, MixIn.class);
WRITER = mapper.writer(filters);
mapper.setFilterProvider(filters);
WRITER = mapper.writerWithDefaultPrettyPrinter();
}
private String name;

View File

@ -59,7 +59,8 @@ public class ListVolumes {
JsonAutoDetect.Visibility.ANY);
mapper.addMixIn(Object.class, MixIn.class);
WRITER = mapper.writer(filters);
mapper.setFilterProvider(filters);
WRITER = mapper.writerWithDefaultPrettyPrinter();
}
/**

View File

@ -58,7 +58,8 @@ public class VolumeInfo implements Comparable<VolumeInfo> {
JsonAutoDetect.Visibility.ANY);
mapper.addMixIn(Object.class, MixIn.class);
WRITER = mapper.writer(filters);
mapper.setFilterProvider(filters);
WRITER = mapper.writerWithDefaultPrettyPrinter();
}
/**