public IPCLoggerChannel(Configuration conf, NamespaceInfo nsInfo, string journalId , IPEndPoint addr) { this.conf = conf; this.nsInfo = nsInfo; this.journalId = journalId; this.addr = addr; this.queueSizeLimitBytes = 1024 * 1024 * conf.GetInt(DFSConfigKeys.DfsQjournalQueueSizeLimitKey , DFSConfigKeys.DfsQjournalQueueSizeLimitDefault); singleThreadExecutor = MoreExecutors.ListeningDecorator(CreateSingleThreadExecutor ()); parallelExecutor = MoreExecutors.ListeningDecorator(CreateParallelExecutor()); metrics = IPCLoggerChannelMetrics.Create(this); }
/// <param name="conf">configuration for the job</param> /// <param name="dirs">the initial list of paths</param> /// <param name="recursive">whether to traverse the patchs recursively</param> /// <param name="inputFilter">inputFilter to apply to the resulting paths</param> /// <param name="newApi">whether using the mapred or mapreduce API</param> /// <exception cref="System.Exception"/> /// <exception cref="System.IO.IOException"/> public LocatedFileStatusFetcher(Configuration conf, Path[] dirs, bool recursive, PathFilter inputFilter, bool newApi) { processInitialInputPathCallback = new LocatedFileStatusFetcher.ProcessInitialInputPathCallback (this); processInputDirCallback = new LocatedFileStatusFetcher.ProcessInputDirCallback(this ); int numThreads = conf.GetInt(FileInputFormat.ListStatusNumThreads, FileInputFormat .DefaultListStatusNumThreads); rawExec = Executors.NewFixedThreadPool(numThreads, new ThreadFactoryBuilder().SetDaemon (true).SetNameFormat("GetFileInfo #%d").Build()); exec = MoreExecutors.ListeningDecorator(rawExec); resultQueue = new LinkedBlockingQueue <IList <FileStatus> >(); this.conf = conf; this.inputDirs = dirs; this.recursive = recursive; this.inputFilter = inputFilter; this.newApi = newApi; }