类org.apache.hadoop.fs.swift.util.JSONUtil源码实例Demo

下面列出了怎么用org.apache.hadoop.fs.swift.util.JSONUtil的API类实例代码及写法,或者点击链接到github查看源代码。

private String[] getRawObjectNames() throws Exception {
  SwiftRestClient client;
  client = SwiftRestClient.getInstance(fs.getUri(), fs.getConf());
  SwiftObjectPath path = SwiftObjectPath.fromPath(fs.getUri(), new Path("/"));
  byte[] bytes = client.listDeepObjectsInDirectory(path, true, true);
  final CollectionType collectionType = JSONUtil.getJsonMapper().
    getTypeFactory().constructCollectionType(List.class,
                                             SwiftObjectFileStatus.class);
  final List<SwiftObjectFileStatus> fileStatusList =
    JSONUtil.toObject(new String(bytes), collectionType);
  final ArrayList<String> objects = new ArrayList();
  for (SwiftObjectFileStatus status : fileStatusList) {
    if (status.getName() != null) {
      objects.add(status.getName());
    } else if (status.getSubdir() != null) {
      objects.add(status.getSubdir());
    }
  }
  return objects.toArray(new String[objects.size()]);
}
 
源代码2 项目: hadoop   文件: SwiftRestClient.java
private StringRequestEntity getAuthenticationRequst(AuthenticationRequest authenticationRequest)
  throws IOException {
  final String data = JSONUtil.toJSON(new AuthenticationRequestWrapper(
          authenticationRequest));
  if (LOG.isDebugEnabled()) {
    LOG.debug("Authenticating with " + authenticationRequest);
  }
  return toJsonEntity(data);
}
 
源代码3 项目: big-c   文件: SwiftRestClient.java
private StringRequestEntity getAuthenticationRequst(AuthenticationRequest authenticationRequest)
  throws IOException {
  final String data = JSONUtil.toJSON(new AuthenticationRequestWrapper(
          authenticationRequest));
  if (LOG.isDebugEnabled()) {
    LOG.debug("Authenticating with " + authenticationRequest);
  }
  return toJsonEntity(data);
}
 
源代码4 项目: sahara-extra   文件: SwiftRestClient.java
private StringRequestEntity getAuthenticationRequst(AuthenticationRequest authenticationRequest)
  throws IOException {
  final String data = JSONUtil.toJSON(new AuthenticationRequestWrapper(
          authenticationRequest));
  if (LOG.isDebugEnabled()) {
    LOG.debug("Authenticating with " + authenticationRequest);
  }
  return toJsonEntity(data);
}
 
 类所在包
 类方法
 同包方法