Java 类org.apache.hadoop.hdfs.tools.offlineEditsViewer.OfflineEditsLoader.OfflineEditsLoaderFactory 实例源码

项目:hadoop    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:aliyun-oss-hadoop-fs    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.toLowerCase().endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:big-c    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:hadoop-plus    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:FlexMap    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:hadoop-TCP    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:hardfs    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}
项目:hadoop-on-lustre2    文件:OfflineEditsViewer.java   
/** Process an edit log using the chosen processor or visitor.
 * 
 * @param inputFilename   The file to process
 * @param outputFilename  The output file name
 * @param processor       If visitor is null, the processor to use
 * @param visitor         If non-null, the visitor to use.
 * 
 * @return                0 on success; error code otherwise
 */
public int go(String inputFileName, String outputFileName, String processor,
    Flags flags, OfflineEditsVisitor visitor)
{
  if (flags.getPrintToScreen()) {
    System.out.println("input  [" + inputFileName  + "]");
    System.out.println("output [" + outputFileName + "]");
  }
  try {
    if (visitor == null) {
      visitor = OfflineEditsVisitorFactory.getEditsVisitor(
          outputFileName, processor, flags.getPrintToScreen());
    }
    boolean xmlInput = inputFileName.endsWith(".xml");
    OfflineEditsLoader loader = OfflineEditsLoaderFactory.
        createLoader(visitor, inputFileName, xmlInput, flags);
    loader.loadEdits();
  } catch(Exception e) {
    System.err.println("Encountered exception. Exiting: " + e.getMessage());
    e.printStackTrace(System.err);
    return -1;
  }
  return 0;
}