Package org.apache.hadoop.hdfs.tools

Examples of org.apache.hadoop.hdfs.tools.FastCopy.copy()


    util.createFiles(fs, topDir);
    FastCopy fastCopy = new FastCopy(conf);
    cluster.shutdownDataNode(0, true);
    try {
      for (String fileName : util.getFileNames(topDir)) {
        fastCopy.copy(fileName, fileName + "dst", (DistributedFileSystem) fs,
            (DistributedFileSystem) fs);
      }
      Map<DatanodeInfo, Integer> dnErrors = fastCopy.getDatanodeErrors();
      assertEquals(1, dnErrors.size());
      int errors = dnErrors.values().iterator().next();
View Full Code Here


    }

    // Now run FastCopy
    try {
      for (String fileName : util.getFileNames(topDir)) {
        fastCopy.copy(fileName, fileName + "dst", (DistributedFileSystem) fs,
            (DistributedFileSystem) fs);
      }

    } catch (ExecutionException e) {
      System.out.println("Expected exception : " + e);
View Full Code Here

    DFSTestUtil.createFile(fs, new Path(filename), MAX_FILE_SIZE, (short) 3,
        System.currentTimeMillis());

    FastCopy fastCopy = new FastCopy(conf);
    try {
      fastCopy.copy(filename, filename + "dst", (DistributedFileSystem) fs,
          (DistributedFileSystem) fs);
    } finally {
      fastCopy.shutdown();
    }
  }
View Full Code Here

    String destination = "/testFastCopyDestination" + hardlink;
    FastCopy fastCopy = new FastCopy(conf);
    NameNode namenode = cluster.getNameNode();
    try {
      for (int i = 0; i < COPIES; i++) {
        fastCopy.copy(src, destination + i, fs, fs);
        assertTrue(verifyCopiedFile(src, destination + i, namenode, namenode,
            fs, fs, hardlink));
        verifyFileStatus(destination + i, namenode, fastCopy);
      }
    } catch (Exception e) {
View Full Code Here

    String destination = "/testFastCopyDestination" + hardlink;
    FastCopy fastCopy = new FastCopy(conf, fs, fs);
    NameNode namenode = cluster.getNameNode();
    try {
      for (int i = 0; i < COPIES; i++) {
        fastCopy.copy(src, destination + i);
        assertTrue(verifyCopiedFile(src, destination + i, namenode, namenode,
            fs, fs, hardlink));
        verifyFileStatus(destination + i, namenode, fastCopy);
      }
    } catch (Exception e) {
View Full Code Here

    for (int i = 0; i < COPIES; i++) {
      requests.add(new FastFileCopyRequest(src, destination + i, fs, fs));
    }
    NameNode namenode = cluster.getNameNode();
    try {
      fastCopy.copy(requests);
      for (FastFileCopyRequest r : requests) {
        assertTrue(verifyCopiedFile(r.getSrc(), r.getDestination(), namenode,
            namenode, fs, fs, hardlink));
        verifyFileStatus(r.getDestination(), namenode, fastCopy);
      }
View Full Code Here

    FastCopy fastCopy = new FastCopy(conf);
    NameNode srcNameNode = cluster.getNameNode();
    NameNode dstNameNode = remoteCluster.getNameNode();
    try {
      for (int i = 0; i < COPIES; i++) {
        fastCopy.copy(src, destination + i, fs, remoteFs);
        assertTrue(verifyCopiedFile(src, destination + i, srcNameNode,
            dstNameNode, fs, remoteFs, hardlink));
        verifyFileStatus(destination + i, dstNameNode, fastCopy);
      }
    } catch (Exception e) {
View Full Code Here

      requests.add(new FastFileCopyRequest(src, destination + i, fs, remoteFs));
    }
    NameNode srcNameNode = cluster.getNameNode();
    NameNode dstNameNode = remoteCluster.getNameNode();
    try {
      fastCopy.copy(requests);
      for (FastFileCopyRequest r : requests) {
        assertTrue(verifyCopiedFile(r.getSrc(), r.getDestination(),
            srcNameNode, dstNameNode, fs, remoteFs, hardlink));
        verifyFileStatus(r.getDestination(), dstNameNode, fastCopy);
      }
View Full Code Here

    DFSTestUtil util = new DFSTestUtil("testFastCopy", 1, 1, 1024 * 5);
    util.createFiles(fs, "/testFastCopy");
    FastCopy fcp = new FastCopy(conf);
    String[] files = util.getFileNames("/testFastCopy");
    assertEquals(1, files.length);
    fcp.copy(files[0], "/dst1", (DistributedFileSystem) fs,
        (DistributedFileSystem) fs);
    assertTrue(FastCopySetupUtil.compareFiles(files[0], fs, "/dst1", fs));

    cluster.failOver();

View Full Code Here

        (DistributedFileSystem) fs);
    assertTrue(FastCopySetupUtil.compareFiles(files[0], fs, "/dst1", fs));

    cluster.failOver();

    fcp.copy(files[0], "/dst2", (DistributedFileSystem) fs,
        (DistributedFileSystem) fs);
    assertTrue(FastCopySetupUtil.compareFiles(files[0], fs, "/dst2", fs));
  }

  private static class FastCopyThread extends Thread {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.