Java Code Examples for org.apache.hadoop.fs.s3.INode.FileType#DIRECTORY

The following examples show how to use org.apache.hadoop.fs.s3.INode.FileType#DIRECTORY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Jets3tFileSystemStore.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder("S3 Filesystem, ");
  sb.append(bucket.getName()).append("\n");
  try {
    S3Object[] objects = s3Service.listObjects(bucket.getName(), PATH_DELIMITER, null);
    for (int i = 0; i < objects.length; i++) {
      Path path = keyToPath(objects[i].getKey());
      sb.append(path).append("\n");
      INode m = retrieveINode(path);
      sb.append("\t").append(m.getFileType()).append("\n");
      if (m.getFileType() == FileType.DIRECTORY) {
        continue;
      }
      for (int j = 0; j < m.getBlocks().length; j++) {
        sb.append("\t").append(m.getBlocks()[j]).append("\n");
      }
    }
  } catch (S3ServiceException e) {
    if (e.getCause() instanceof IOException) {
      throw (IOException) e.getCause();
    }
    throw new S3Exception(e);
  }
  System.out.println(sb);
}
 
Example 2
Source File: InMemoryFileSystemStore.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder(getClass().getSimpleName());
  sb.append(", \n");
  for (Map.Entry<Path, INode> entry : inodes.entrySet()) {
    sb.append(entry.getKey()).append("\n");
    INode inode = entry.getValue();
    sb.append("\t").append(inode.getFileType()).append("\n");
    if (inode.getFileType() == FileType.DIRECTORY) {
      continue;
    }
    for (int j = 0; j < inode.getBlocks().length; j++) {
      sb.append("\t").append(inode.getBlocks()[j]).append("\n");
    }      
  }
  System.out.println(sb);
  
  System.out.println(inodes.keySet());
  System.out.println(blocks.keySet());
}
 
Example 3
Source File: Jets3tFileSystemStore.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder("S3 Filesystem, ");
  sb.append(bucket.getName()).append("\n");
  try {
    S3Object[] objects = s3Service.listObjects(bucket.getName(), PATH_DELIMITER, null);
    for (int i = 0; i < objects.length; i++) {
      Path path = keyToPath(objects[i].getKey());
      sb.append(path).append("\n");
      INode m = retrieveINode(path);
      sb.append("\t").append(m.getFileType()).append("\n");
      if (m.getFileType() == FileType.DIRECTORY) {
        continue;
      }
      for (int j = 0; j < m.getBlocks().length; j++) {
        sb.append("\t").append(m.getBlocks()[j]).append("\n");
      }
    }
  } catch (S3ServiceException e) {
    if (e.getCause() instanceof IOException) {
      throw (IOException) e.getCause();
    }
    throw new S3Exception(e);
  }
  System.out.println(sb);
}
 
Example 4
Source File: InMemoryFileSystemStore.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder(getClass().getSimpleName());
  sb.append(", \n");
  for (Map.Entry<Path, INode> entry : inodes.entrySet()) {
    sb.append(entry.getKey()).append("\n");
    INode inode = entry.getValue();
    sb.append("\t").append(inode.getFileType()).append("\n");
    if (inode.getFileType() == FileType.DIRECTORY) {
      continue;
    }
    for (int j = 0; j < inode.getBlocks().length; j++) {
      sb.append("\t").append(inode.getBlocks()[j]).append("\n");
    }      
  }
  System.out.println(sb);
  
  System.out.println(inodes.keySet());
  System.out.println(blocks.keySet());
}
 
Example 5
Source File: InMemoryFileSystemStore.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder(getClass().getSimpleName());
  sb.append(", \n");
  for (Map.Entry<Path, INode> entry : inodes.entrySet()) {
    sb.append(entry.getKey()).append("\n");
    INode inode = entry.getValue();
    sb.append("\t").append(inode.getFileType()).append("\n");
    if (inode.getFileType() == FileType.DIRECTORY) {
      continue;
    }
    for (int j = 0; j < inode.getBlocks().length; j++) {
      sb.append("\t").append(inode.getBlocks()[j]).append("\n");
    }      
  }
  System.out.println(sb);
  
  System.out.println(inodes.keySet());
  System.out.println(blocks.keySet());
}
 
Example 6
Source File: Jets3tFileSystemStore.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder("S3 Filesystem, ");
  sb.append(bucket.getName()).append("\n");
  try {
    S3Object[] objects = s3Service.listObjects(bucket, PATH_DELIMITER, null);
    for (int i = 0; i < objects.length; i++) {
      Path path = keyToPath(objects[i].getKey());
      sb.append(path).append("\n");
      INode m = retrieveINode(path);
      sb.append("\t").append(m.getFileType()).append("\n");
      if (m.getFileType() == FileType.DIRECTORY) {
        continue;
      }
      for (int j = 0; j < m.getBlocks().length; j++) {
        sb.append("\t").append(m.getBlocks()[j]).append("\n");
      }
    }
  } catch (S3ServiceException e) {
    if (e.getCause() instanceof IOException) {
      throw (IOException) e.getCause();
    }
    throw new S3Exception(e);
  }
  System.out.println(sb);
}
 
Example 7
Source File: InMemoryFileSystemStore.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder(getClass().getSimpleName());
  sb.append(", \n");
  for (Map.Entry<Path, INode> entry : inodes.entrySet()) {
    sb.append(entry.getKey()).append("\n");
    INode inode = entry.getValue();
    sb.append("\t").append(inode.getFileType()).append("\n");
    if (inode.getFileType() == FileType.DIRECTORY) {
      continue;
    }
    for (int j = 0; j < inode.getBlocks().length; j++) {
      sb.append("\t").append(inode.getBlocks()[j]).append("\n");
    }      
  }
  System.out.println(sb);
  
  System.out.println(inodes.keySet());
  System.out.println(blocks.keySet());
}
 
Example 8
Source File: Jets3tFileSystemStore.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
public void dump() throws IOException {
  StringBuilder sb = new StringBuilder("S3 Filesystem, ");
  sb.append(bucket.getName()).append("\n");
  try {
    S3Object[] objects = s3Service.listObjects(bucket, PATH_DELIMITER, null);
    for (int i = 0; i < objects.length; i++) {
      Path path = keyToPath(objects[i].getKey());
      sb.append(path).append("\n");
      INode m = retrieveINode(path);
      sb.append("\t").append(m.getFileType()).append("\n");
      if (m.getFileType() == FileType.DIRECTORY) {
        continue;
      }
      for (int j = 0; j < m.getBlocks().length; j++) {
        sb.append("\t").append(m.getBlocks()[j]).append("\n");
      }
    }
  } catch (S3ServiceException e) {
    if (e.getCause() instanceof IOException) {
      throw (IOException) e.getCause();
    }
    throw new S3Exception(e);
  }
  System.out.println(sb);
}