DistCpOptions { @Override public String toString() { return "DistCpOptions{" + "atomicCommit=" + atomicCommit + ", syncFolder=" + syncFolder + ", deleteMissing=" + deleteMissing + ", ignoreFailures=" + ignoreFailures + ", overwrite=" + overwrite + ", append=" + append + ", useDiff=" + useDiff + ", useRdiff=" + useRdiff + ", fromSnapshot=" + fromSnapshot + ", toSnapshot=" + toSnapshot + ", skipCRC=" + skipCRC + ", blocking=" + blocking + ", numListstatusThreads=" + numListstatusThreads + ", maxMaps=" + maxMaps + ", mapBandwidth=" + mapBandwidth + ", copyStrategy='" + copyStrategy + '\'' + ", preserveStatus=" + preserveStatus + ", atomicWorkPath=" + atomicWorkPath + ", logPath=" + logPath + ", sourceFileListing=" + sourceFileListing + ", sourcePaths=" + sourcePaths + ", targetPath=" + targetPath + ", filtersFile='" + filtersFile + '\'' + ", blocksPerChunk=" + blocksPerChunk + ", copyBufferSize=" + copyBufferSize + ", verboseLog=" + verboseLog + ", directWrite=" + directWrite + '}'; } private  DistCpOptions(Builder builder); Path getSourceFileListing(); List<Path> getSourcePaths(); Path getTargetPath(); boolean shouldAtomicCommit(); Path getAtomicWorkPath(); boolean shouldSyncFolder(); boolean shouldDeleteMissing(); boolean shouldIgnoreFailures(); boolean shouldOverwrite(); boolean shouldAppend(); boolean shouldSkipCRC(); boolean shouldBlock(); boolean shouldUseDiff(); boolean shouldUseRdiff(); boolean shouldUseSnapshotDiff(); String getFromSnapshot(); String getToSnapshot(); String getFiltersFile(); Path getLogPath(); String getCopyStrategy(); int getNumListstatusThreads(); int getMaxMaps(); float getMapBandwidth(); Set<FileAttribute> getPreserveAttributes(); boolean shouldPreserve(FileAttribute attribute); int getBlocksPerChunk(); int getCopyBufferSize(); boolean shouldVerboseLog(); Path getTrackPath(); boolean shouldDirectWrite(); void appendToConf(Configuration conf); @Override String toString(); static final int MAX_NUM_LISTSTATUS_THREADS; }
@Test public void testToString() { DistCpOptions option = new DistCpOptions.Builder(new Path("abc"), new Path("xyz")).build(); String val = "DistCpOptions{atomicCommit=false, syncFolder=false, " + "deleteMissing=false, ignoreFailures=false, overwrite=false, " + "append=false, useDiff=false, useRdiff=false, " + "fromSnapshot=null, toSnapshot=null, " + "skipCRC=false, blocking=true, numListstatusThreads=0, maxMaps=20, " + "mapBandwidth=0.0, copyStrategy='uniformsize', preserveStatus=[], " + "atomicWorkPath=null, logPath=null, sourceFileListing=abc, " + "sourcePaths=null, targetPath=xyz, filtersFile='null', " + "blocksPerChunk=0, copyBufferSize=8192, verboseLog=false, " + "directWrite=false}"; String optionString = option.toString(); Assert.assertEquals(val, optionString); Assert.assertNotSame(DistCpOptionSwitch.ATOMIC_COMMIT.toString(), DistCpOptionSwitch.ATOMIC_COMMIT.name()); }