@Test public void copyFromLocalLargeTest() throws IOException { File testFile = new File(mLocalTachyonCluster.getTachyonHome() + "/testFile"); testFile.createNewFile(); FileOutputStream fos = new FileOutputStream(testFile); byte toWrite[] = TestUtils.getIncreasingByteArray(mSizeBytes); fos.write(toWrite); fos.close(); mFsShell .copyFromLocal(new String[] { "copyFromLocal", testFile.getAbsolutePath(), "/testFile" }); Assert .assertEquals(getCommandOutput(new String[] { "copyFromLocal", testFile.getAbsolutePath(), "/testFile" }), mOutput.toString()); TachyonFile tFile = mTfs.getFile("/testFile"); Assert.assertNotNull(tFile); Assert.assertEquals(mSizeBytes, tFile.length()); InStream tfis = tFile.getInStream(ReadType.NO_CACHE); byte read[] = new byte[mSizeBytes]; tfis.read(read); Assert.assertTrue(TestUtils.equalIncreasingByteArray(mSizeBytes, read)); }
public int copyFromLocal(String argv[]) throws IOException { if (argv.length != 3) { System.out.println("Usage: tfs copyFromLocal <src> <remoteDst>"); return -1; } String srcPath = argv[1]; String dstPath = argv[2]; File src = new File(srcPath); if (!src.exists()) { System.out.println("Local path " + srcPath + " does not exist."); return -1; } TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(dstPath)); String file = Utils.getFilePath(dstPath); int ret = copyPath(src, tachyonClient, file); if (ret == 0) { System.out.println("Copied " + src.getPath() + " to " + dstPath); } return ret; }
TFsShell { public int copyFromLocal(String argv[]) throws IOException { if (argv.length != 3) { System.out.println("Usage: tfs copyFromLocal <src> <remoteDst>"); return -1; } String srcPath = argv[1]; String dstPath = argv[2]; File src = new File(srcPath); if (!src.exists()) { System.out.println("Local path " + srcPath + " does not exist."); return -1; } TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(dstPath)); String file = Utils.getFilePath(dstPath); int ret = copyPath(src, tachyonClient, file); if (ret == 0) { System.out.println("Copied " + src.getPath() + " to " + dstPath); } return ret; } }
TFsShell { public int copyFromLocal(String argv[]) throws IOException { if (argv.length != 3) { System.out.println("Usage: tfs copyFromLocal <src> <remoteDst>"); return -1; } String srcPath = argv[1]; String dstPath = argv[2]; File src = new File(srcPath); if (!src.exists()) { System.out.println("Local path " + srcPath + " does not exist."); return -1; } TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(dstPath)); String file = Utils.getFilePath(dstPath); int ret = copyPath(src, tachyonClient, file); if (ret == 0) { System.out.println("Copied " + src.getPath() + " to " + dstPath); } return ret; }  }
TFsShell { public int copyFromLocal(String argv[]) throws IOException { if (argv.length != 3) { System.out.println("Usage: tfs copyFromLocal <src> <remoteDst>"); return -1; } String srcPath = argv[1]; String dstPath = argv[2]; File src = new File(srcPath); if (!src.exists()) { System.out.println("Local path " + srcPath + " does not exist."); return -1; } TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(dstPath)); String file = Utils.getFilePath(dstPath); int ret = copyPath(src, tachyonClient, file); if (ret == 0) { System.out.println("Copied " + src.getPath() + " to " + dstPath); } return ret; }  static void main(String argv[]); int cat(String argv[]); int copyFromLocal(String argv[]); int copyToLocal(String argv[]); int count(String argv[]); int fileinfo(String argv[]); int location(String argv[]); int ls(String argv[]); int lsr(String argv[]); int mkdir(String argv[]); int pin(String argv[]); int unpin(String argv[]); void printUsage(); int rename(String argv[]); int report(String argv[]); int request(String argv[]); int rm(String argv[]); int run(String argv[]); int tail(String argv[]); int touch(String argv[]); }
TFsShell { public int copyFromLocal(String argv[]) throws IOException { if (argv.length != 3) { System.out.println("Usage: tfs copyFromLocal <src> <remoteDst>"); return -1; } String srcPath = argv[1]; String dstPath = argv[2]; File src = new File(srcPath); if (!src.exists()) { System.out.println("Local path " + srcPath + " does not exist."); return -1; } TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(dstPath)); String file = Utils.getFilePath(dstPath); int ret = copyPath(src, tachyonClient, file); if (ret == 0) { System.out.println("Copied " + src.getPath() + " to " + dstPath); } return ret; }  static void main(String argv[]); int cat(String argv[]); int copyFromLocal(String argv[]); int copyToLocal(String argv[]); int count(String argv[]); int fileinfo(String argv[]); int location(String argv[]); int ls(String argv[]); int lsr(String argv[]); int mkdir(String argv[]); int pin(String argv[]); int unpin(String argv[]); void printUsage(); int rename(String argv[]); int report(String argv[]); int request(String argv[]); int rm(String argv[]); int run(String argv[]); int tail(String argv[]); int touch(String argv[]);  }