Set the number of concurrent writer processes.
<p>
If set to 0, this disables compaction.

@param numWriters the number of concurrent writer processes
@return this for method chaining
19414
public TransformTask setNumWriters(int numWriters) {
    Preconditions.checkArgument(numWriters >= 0,
        "Invalid number of reducers: " + numWriters);
    if (numWriters == 0) {
      noCompaction();
    } else {
      this.numWriters = numWriters;
    }
    return this;
  }
367591
@Override
  public void setNumThreadsForParsing(Integer numThreadsForParsing) {
    if (numThreadsForParsing == null) {
      this.numThreadsForParsing = Runtime.getRuntime().availableProcessors();
      return;
    }
    if (numThreadsForParsing < 1) {
      throw new IllegalArgumentException("The number of threads can not be less than 1.");
    }
    this.numThreadsForParsing = numThreadsForParsing;
  }
1180470
public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException {
    /* See http://prometheus.io/docs/instrumenting/exposition_formats/
     * for the output format specification. */
    while(mfs.hasMoreElements()) {
      Collector.MetricFamilySamples metricFamilySamples = mfs.nextElement();
      writer.write("# HELP ");
      writer.write(metricFamilySamples.name);
      writer.write(' ');
      writeEscapedHelp(writer, metricFamilySamples.help);
      writer.write('\n');

      writer.write("# TYPE ");
      writer.write(metricFamilySamples.name);
      writer.write(' ');
      writer.write(typeString(metricFamilySamples.type));
      writer.write('\n');

      for (Collector.MetricFamilySamples.Sample sample: metricFamilySamples.samples) {
        writer.write(sample.name);
        if (sample.labelNames.size() > 0) {
          writer.write('{');
          for (int i = 0; i < sample.labelNames.size(); ++i) {
            writer.write(sample.labelNames.get(i));
            writer.write("=\"");
            writeEscapedLabelValue(writer, sample.labelValues.get(i));
            writer.write("\",");
          }
          writer.write('}');
        }
        writer.write(' ');
        writer.write(Collector.doubleToGoString(sample.value));
        if (sample.timestampMs != null){
          writer.write(' ');
          writer.write(sample.timestampMs.toString());
        }
        writer.write('\n');
      }
    }
  }
840472
public void setProcessImages(int processImages) {
		this.processImages = processImages;
		getConfig().setProperty(PROCESS_IMAGES, Integer.toString(processImages));
	}
980284
public ExecutorCommand<V> withExcludedExceptions(List<Class<? extends Exception>> excludedExceptions) {
        config.setExcludedExceptions(excludedExceptions);
        return this;
    }
348278
public HttpRequestBuilder withRetries(int n) {
    Preconditions.checkArg(n >= 0, "number of retries must be >= 0");
    this.numAttempts = n + 1;
    entry.withMaxAttempts(numAttempts);
    return this;
  }
107952
protected Record next(Writer writer) {
        Value value = recordIte.next();

        if (valuesLabels != null) {
            int i = 0;
            for (ValueWritable vw : value.getValues()) {
                vw.getLabel().set(valuesLabels[i++]);
            }
        }

        currentRecord.setValue(value);
        writer.setDefaultRecord(currentRecord);
        return currentRecord;
    }
309468
@Override
  public List<List<O>> finish(Collection<? extends OutputWriter<O>> writers) {
    ImmutableList.Builder<List<O>> out = ImmutableList.builder();
    for (OutputWriter<O> w : writers) {
      InMemoryOutputWriter<O> writer = (InMemoryOutputWriter<O>) w;
      out.add(ImmutableList.copyOf(writer.getResult()));
    }
    return out.build();
  }
706045
@SuppressWarnings("unchecked")
    public void setWriterPostProcessors(Set<String> writerPostProcessors) {
        if (writePostProcessors == null) {
            writePostProcessors = new LinkedList<>();
        }
        for (String writerPostProcessor : writerPostProcessors) {
            try {
                writePostProcessors.add((Class<IPostProcessor>) Class.forName(writerPostProcessor));
            } catch (Exception e) {
                log.debug("Write post process implementation: {} was not found", writerPostProcessor);
            }
        }
    }
814255
public void setThreadPoolSize( int threads ) {
		if( threads <= 0 )
			throw new IllegalArgumentException("Number of threads must be greater than 0");
		if( verbose )
			Log.i(TAG,"setThreadPoolSize("+threads+")");

		threadPool.setCorePoolSize(threads);
		threadPool.setMaximumPoolSize(threads);
	}
1000053
public void setWriter (Writer writer) {
		if (!(writer instanceof JsonWriter)) writer = new JsonWriter(writer);
		this.writer = (JsonWriter)writer;
		this.writer.setOutputType(outputType);
		this.writer.setQuoteLongValues(quoteLongValues);
	}
1042793
public CacheSimpleConfig setCacheWriter(String cacheWriter) {
        if (cacheWriter != null && cacheWriterFactory != null) {
            throw new IllegalStateException("Cannot set cacheWriter to '" + cacheWriter
                    + "', because cacheWriterFactory is already set to '" + cacheWriterFactory + "'.");
        }
        this.cacheWriter = cacheWriter;
        return this;
    }
934526
public static long getProcessedCount(List<TaskState> taskStates) {
    long value = 0;

    for (TaskState taskState : taskStates) {
      value += taskState.getPropAsLong(ConfigurationKeys.WRITER_RECORDS_WRITTEN, 0);
    }

    return value;
  }
855990
public void setOutputWriter(Writer writer) {
        if (writer instanceof PrintWriter) {
            this.out = (PrintWriter) writer;
        } else if (writer == null) {
            this.out = null;
        } else {
            this.out = new PrintWriter(writer);
        }
    }
756264
public DataWriterBuilder<S, D> withWriterId(String writerId) {
    this.writerId = writerId;
    log.debug("withWriterId : {}", this.writerId);
    return this;
  }
536501
@Override
    public void write(final Writer writer) throws ConfigurationException, IOException {
        Preconditions.checkNotNull(writer);

        @SuppressWarnings("unchecked") final
        HashMap<String, Object> settings = (HashMap<String, Object>) fromNode(this.getModel().getInMemoryRepresentation());
        this.mapper.writerWithDefaultPrettyPrinter().writeValue(writer, settings);
    }
466674
@Override
    public void setLimitOnNumberOfHeaders(int size) {
        if (0 >= size) {
            throw new IllegalArgumentException("Invalid limit on number headers: " + size);
        }
        this.limitNumHeaders = size;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Limit on number of headers now: " + this.limitNumHeaders);
        }
    }