Search in sources :

Example 1 with AsyncDataWriter

use of org.apache.gobblin.writer.AsyncDataWriter in project incubator-gobblin by apache.

the class CouchbaseWriterBuilder method build.

@Override
public DataWriter build() throws IOException {
    State state = this.destination.getProperties();
    Properties taskProps = state.getProperties();
    Config config = ConfigUtils.propertiesToConfig(taskProps);
    CouchbaseEnvironment couchbaseEnvironment = CouchbaseEnvironmentFactory.getInstance(config);
    // TODO: Read config to decide whether to build a blocking writer or an async writer
    // build an async couchbase writer
    AsyncDataWriter couchbaseWriter = new CouchbaseWriter(couchbaseEnvironment, config);
    return AsyncWriterManager.builder().asyncDataWriter(couchbaseWriter).failureAllowanceRatio(0.0).retriesEnabled(false).config(config).build();
}
Also used : State(org.apache.gobblin.configuration.State) Config(com.typesafe.config.Config) AsyncDataWriter(org.apache.gobblin.writer.AsyncDataWriter) CouchbaseEnvironment(com.couchbase.client.java.env.CouchbaseEnvironment) Properties(java.util.Properties)

Aggregations

CouchbaseEnvironment (com.couchbase.client.java.env.CouchbaseEnvironment)1 Config (com.typesafe.config.Config)1 Properties (java.util.Properties)1 State (org.apache.gobblin.configuration.State)1 AsyncDataWriter (org.apache.gobblin.writer.AsyncDataWriter)1