Java 类org.apache.hadoop.fs.s3.INode.FileType 实例源码

项目:hadoop    文件:Jets3tFileSystemStore.java   
@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);
}
项目:hadoop    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop    文件:InMemoryFileSystemStore.java   
@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());
}
项目:aliyun-oss-hadoop-fs    文件:Jets3tFileSystemStore.java   
@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);
}
项目:aliyun-oss-hadoop-fs    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:aliyun-oss-hadoop-fs    文件:InMemoryFileSystemStore.java   
@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());
}
项目:big-c    文件:Jets3tFileSystemStore.java   
@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);
}
项目:big-c    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:big-c    文件:InMemoryFileSystemStore.java   
@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());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:Jets3tFileSystemStore.java   
@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);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop-2.6.0-cdh5.4.3    文件:InMemoryFileSystemStore.java   
@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());
}
项目:hadoop-EAR    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop-EAR    文件:InMemoryFileSystemStore.java   
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());
}
项目:hadoop-EAR    文件:Jets3tFileSystemStore.java   
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);
}
项目:hadoop-plus    文件:Jets3tFileSystemStore.java   
@Override
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);
}
项目:hadoop-plus    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop-plus    文件:InMemoryFileSystemStore.java   
@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());
}
项目:hadoop-TCP    文件:Jets3tFileSystemStore.java   
@Override
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);
}
项目:hadoop-TCP    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop-TCP    文件:InMemoryFileSystemStore.java   
@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());
}
项目:hadoop-on-lustre    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop-on-lustre    文件:InMemoryFileSystemStore.java   
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());
}
项目:hadoop-on-lustre    文件:Jets3tFileSystemStore.java   
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);
}
项目:hardfs    文件:Jets3tFileSystemStore.java   
@Override
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);
}
项目:hardfs    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hardfs    文件:InMemoryFileSystemStore.java   
@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());
}
项目:hadoop-on-lustre2    文件:Jets3tFileSystemStore.java   
@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);
}
项目:hadoop-on-lustre2    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop-on-lustre2    文件:InMemoryFileSystemStore.java   
@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());
}
项目:RDFS    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:RDFS    文件:InMemoryFileSystemStore.java   
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());
}
项目:RDFS    文件:Jets3tFileSystemStore.java   
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);
}
项目:hadoop-0.20    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hadoop-0.20    文件:InMemoryFileSystemStore.java   
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());
}
项目:hadoop-0.20    文件:Jets3tFileSystemStore.java   
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);
}
项目:hortonworks-extension    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}
项目:hortonworks-extension    文件:InMemoryFileSystemStore.java   
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());
}
项目:hortonworks-extension    文件:Jets3tFileSystemStore.java   
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);
}
项目:hortonworks-extension    文件:TestINode.java   
public void testSerializeFileWithSingleBlock() throws IOException {
  Block[] blocks = { new Block(849282477840258181L, 128L) };
  INode inode = new INode(FileType.FILE, blocks);

  assertEquals("Length", 1L + 4 + 16, inode.getSerializedLength());
  InputStream in = inode.serialize();

  INode deserialized = INode.deserialize(in);

  assertEquals("FileType", inode.getFileType(), deserialized.getFileType());
  Block[] deserializedBlocks = deserialized.getBlocks();
  assertEquals("Length", 1, deserializedBlocks.length);
  assertEquals("Id", blocks[0].getId(), deserializedBlocks[0].getId());
  assertEquals("Length", blocks[0].getLength(), deserializedBlocks[0]
               .getLength());

}