/** * The directory where to write the sstables. * <p> * This is a mandatory option. * * @param directory the directory to use, which should exists and be writable. * @return this builder. * * @throws IllegalArgumentException if {@code directory} doesn't exist or is not writable. */ public Builder inDirectory(String directory) { return inDirectory(new File(directory)); }
if (cfMetaData == null) Types types = createTypes(keyspace); cfMetaData = createTable(types); Pair<UpdateStatement, List<ColumnSpecification>> preparedInsert = prepareInsert();
if (cfMetaData == null) Types types = createTypes(keyspace); cfMetaData = createTable(types); Pair<UpdateStatement, List<ColumnSpecification>> preparedInsert = prepareInsert();
if (cfMetaData == null) Types types = createTypes(keyspace); cfMetaData = createTable(types); Pair<UpdateStatement, List<ColumnSpecification>> preparedInsert = prepareInsert();
.forTable(schema) .using(insertStatement) .withPartitioner(ConfigHelper.getOutputPartitioner(conf)) .inDirectory(outputDir) .withBufferSizeInMB(Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64"))) .build();
private void prepareWriter() throws IOException { if (writer == null) { writer = CQLSSTableWriter.builder() .forTable(schema) .using(insertStatement) .withPartitioner(ConfigHelper.getOutputPartitioner(conf)) .inDirectory(outputDir) .withBufferSizeInMB(Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64"))) .withPartitioner(partitioner) .build(); } if (loader == null) { ExternalClient externalClient = new ExternalClient(conf); externalClient.setTableMetadata(CFMetaData.compile(schema, keyspace)); loader = new SSTableLoader(outputDir, externalClient, new NullOutputHandler()) { @Override public void onSuccess(StreamState finalState) { if (deleteSrc) FileUtils.deleteRecursive(outputDir); } }; } }
private CQLSSTableWriter createWriter() { String schema = "CREATE TABLE " + keyspace + ".data ( " + "tenant_id text, " + "type tinyint, " + "metric text, " + "dpart bigint, " + "time timeuuid, " + "data_retention int static, " + "n_value double, " + "availability blob, " + "l_value bigint, " + // Commenting out the aggregates column because there appears to be a bug in the C* // code that breaks CQLSSTableWriter when the schema includes a collection. Fortunately, // we are not using the column so it can safely be ignored. // "aggregates set<frozen <aggregate_data>>, " + "PRIMARY KEY ((tenant_id, type, metric, dpart), time) " + ") WITH CLUSTERING ORDER BY (time DESC)"; String insertGauge = "INSERT INTO " + keyspace + ".data (tenant_id, type, metric, dpart, time, n_value) " + "VALUES (?, ?, ?, ?, ?, ?)"; return CQLSSTableWriter.builder() .inDirectory(dataDir) .forTable(schema) .using(insertGauge) .withBufferSizeInMB(bufferSize) .build(); }
private void prepareWriter() throws IOException { if (writer == null) { writer = CQLSSTableWriter.builder() .forTable(schema) .using(insertStatement) .withPartitioner(ConfigHelper.getOutputPartitioner(conf)) .inDirectory(outputDir) .withBufferSizeInMB(Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64"))) .withPartitioner(partitioner) .build(); } if (loader == null) { ExternalClient externalClient = new ExternalClient(conf); externalClient.setTableMetadata(CFMetaData.compile(schema, keyspace)); loader = new SSTableLoader(outputDir, externalClient, new NullOutputHandler()) { @Override public void onSuccess(StreamState finalState) { if (deleteSrc) FileUtils.deleteRecursive(outputDir); } }; } }
private void prepareWriter() throws IOException { if (writer == null) { writer = CQLSSTableWriter.builder() .forTable(schema) .using(insertStatement) .withPartitioner(ConfigHelper.getOutputPartitioner(conf)) .inDirectory(outputDir) .withBufferSizeInMB(Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64"))) .withPartitioner(partitioner) .build(); } if (loader == null) { ExternalClient externalClient = new ExternalClient(conf); externalClient.setTableMetadata(CFMetaData.compile(schema, keyspace)); loader = new SSTableLoader(outputDir, externalClient, new NullOutputHandler()) { @Override public void onSuccess(StreamState finalState) { if (deleteSrc) FileUtils.deleteRecursive(outputDir); } }; } }
/** * The directory where to write the sstables. * <p> * This is a mandatory option. * * @param directory the directory to use, which should exists and be writable. * @return this builder. * * @throws IllegalArgumentException if {@code directory} doesn't exist or is not writable. */ public Builder inDirectory(String directory) { return inDirectory(new File(directory)); }
/** * The directory where to write the sstables. * <p> * This is a mandatory option. * * @param directory the directory to use, which should exists and be writable. * @return this builder. * * @throws IllegalArgumentException if {@code directory} doesn't exist or is not writable. */ public Builder inDirectory(String directory) { return inDirectory(new File(directory)); }
/** * The directory where to write the sstables. * <p> * This is a mandatory option. * * @param directory the directory to use, which should exists and be writable. * @return this builder. * * @throws IllegalArgumentException if {@code directory} doesn't exist or is not writable. */ public Builder inDirectory(String directory) { return inDirectory(new File(directory)); }
/** * Returns a new builder for a CQLSSTableWriter. * * @return the new builder. */ public static Builder builder() { return new Builder(); }
/** * Returns a new builder for a CQLSSTableWriter. * * @return the new builder. */ public static Builder builder() { return new Builder(); }
/** * Returns a new builder for a CQLSSTableWriter. * * @return the new builder. */ public static Builder builder() { return new Builder(); }
/** * Returns a new builder for a CQLSSTableWriter. * * @return the new builder. */ public static Builder builder() { return new Builder(); }