Tabnine Logo
LogCopier$Builder.useSrcFileSystem
Code IndexAdd Tabnine to your IDE (free)

How to use
useSrcFileSystem
method
in
org.apache.gobblin.util.logs.LogCopier$Builder

Best Java code snippets using org.apache.gobblin.util.logs.LogCopier$Builder.useSrcFileSystem (Showing top 4 results out of 315)

origin: apache/incubator-gobblin

private LogCopier buildLogCopier(Config config, Path sinkLogDir, Path appWorkDir) throws IOException {
 FileSystem rawLocalFs = this.closer.register(new RawLocalFileSystem());
 rawLocalFs.initialize(URI.create(ConfigurationKeys.LOCAL_FS_URI), new Configuration());
 LogCopier.Builder builder = LogCopier.newBuilder()
     .useSrcFileSystem(this.fs)
     .useDestFileSystem(rawLocalFs)
     .readFrom(getHdfsLogDir(appWorkDir))
     .writeTo(sinkLogDir)
     .acceptsLogFileExtensions(ImmutableSet.of(ApplicationConstants.STDOUT, ApplicationConstants.STDERR));
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE)) {
  builder.useMaxBytesPerLogFile(config.getBytes(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE));
 }
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER)) {
  builder.useScheduler(config.getString(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER));
 }
 return builder.build();
}
origin: apache/incubator-gobblin

/**
 * Build a {@link LogCopier} instance used to copy the logs out from this {@link GobblinYarnLogSource}.
 *
 * @param config the {@link Config} use to create the {@link LogCopier}
 * @param containerId the {@link ContainerId} of the container the {@link LogCopier} runs in
 * @param destFs the destination {@link FileSystem}
 * @param appWorkDir the Gobblin Yarn application working directory on HDFS
 * @return a {@link LogCopier} instance
 * @throws IOException if it fails on any IO operation
 */
protected LogCopier buildLogCopier(Config config, ContainerId containerId, FileSystem destFs, Path appWorkDir)
  throws IOException {
 LogCopier.Builder builder = LogCopier.newBuilder()
     .useSrcFileSystem(FileSystem.getLocal(new Configuration()))
     .useDestFileSystem(destFs)
     .readFrom(getLocalLogDir())
     .writeTo(getHdfsLogDir(containerId, destFs, appWorkDir))
     .acceptsLogFileExtensions(ImmutableSet.of(ApplicationConstants.STDOUT, ApplicationConstants.STDERR))
     .useLogFileNamePrefix(containerId.toString());
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE)) {
  builder.useMaxBytesPerLogFile(config.getBytes(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE));
 }
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER)) {
  builder.useScheduler(config.getString(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER));
 }
 return builder.build();
}
origin: org.apache.gobblin/gobblin-yarn

private LogCopier buildLogCopier(Config config, Path sinkLogDir, Path appWorkDir) throws IOException {
 FileSystem rawLocalFs = this.closer.register(new RawLocalFileSystem());
 rawLocalFs.initialize(URI.create(ConfigurationKeys.LOCAL_FS_URI), new Configuration());
 LogCopier.Builder builder = LogCopier.newBuilder()
     .useSrcFileSystem(this.fs)
     .useDestFileSystem(rawLocalFs)
     .readFrom(getHdfsLogDir(appWorkDir))
     .writeTo(sinkLogDir)
     .acceptsLogFileExtensions(ImmutableSet.of(ApplicationConstants.STDOUT, ApplicationConstants.STDERR));
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE)) {
  builder.useMaxBytesPerLogFile(config.getBytes(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE));
 }
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER)) {
  builder.useScheduler(config.getString(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER));
 }
 return builder.build();
}
origin: org.apache.gobblin/gobblin-yarn

/**
 * Build a {@link LogCopier} instance used to copy the logs out from this {@link GobblinYarnLogSource}.
 *
 * @param config the {@link Config} use to create the {@link LogCopier}
 * @param containerId the {@link ContainerId} of the container the {@link LogCopier} runs in
 * @param destFs the destination {@link FileSystem}
 * @param appWorkDir the Gobblin Yarn application working directory on HDFS
 * @return a {@link LogCopier} instance
 * @throws IOException if it fails on any IO operation
 */
protected LogCopier buildLogCopier(Config config, ContainerId containerId, FileSystem destFs, Path appWorkDir)
  throws IOException {
 LogCopier.Builder builder = LogCopier.newBuilder()
     .useSrcFileSystem(FileSystem.getLocal(new Configuration()))
     .useDestFileSystem(destFs)
     .readFrom(getLocalLogDir())
     .writeTo(getHdfsLogDir(containerId, destFs, appWorkDir))
     .acceptsLogFileExtensions(ImmutableSet.of(ApplicationConstants.STDOUT, ApplicationConstants.STDERR))
     .useLogFileNamePrefix(containerId.toString());
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE)) {
  builder.useMaxBytesPerLogFile(config.getBytes(GobblinYarnConfigurationKeys.LOG_COPIER_MAX_FILE_SIZE));
 }
 if (config.hasPath(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER)) {
  builder.useScheduler(config.getString(GobblinYarnConfigurationKeys.LOG_COPIER_SCHEDULER));
 }
 return builder.build();
}
org.apache.gobblin.util.logsLogCopier$BuilderuseSrcFileSystem

Javadoc

Set the source FileSystem for reading the source log file.

Popular methods of LogCopier$Builder

  • <init>
  • acceptsLogFileExtensions
    Set the set of acceptable log file extensions.
  • build
    Build a new LogCopier instance.
  • readFrom
    Set the path of the source log file directory to read from.
  • useDestFileSystem
    Set the destination FileSystem for writing the destination log file.
  • useLogFileNamePrefix
    Set the log file name prefix at the destination.
  • useMaxBytesPerLogFile
    Set the max bytes per log file.
  • useScheduler
    Set the scheduler to use for scheduling copy tasks.
  • writeTo
    Set the path of the destination log file directory to write to.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Kernel (java.awt.image)
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now