@Test public void testCreateInsertStatement() throws Exception { Insert insert= service.createInsertStatement(TABLE, columns, "timestamp"); assertEquals("Expected keyspace not found", "\"" + STREAMING.STREAMING_KEYSPACE_NAME + "\"", insert.getKeyspace()); }
public Insert createInsertStatement(String streamName, List<ColumnNameTypeValue> columns, String timestampColumnName) { Insert insert = QueryBuilder.insertInto(addQuotes(STREAMING.STREAMING_KEYSPACE_NAME), addQuotes(streamName)); for (ColumnNameTypeValue column : columns) { insert.value(addQuotes(column.getColumn()), column.getValue()); } insert.value(addQuotes(timestampColumnName), UUIDs.timeBased()); return insert; }
SaveToCassandraOperationsService { public Insert createInsertStatement(String streamName, List<ColumnNameTypeValue> columns, String timestampColumnName) { Insert insert = QueryBuilder.insertInto(addQuotes(STREAMING.STREAMING_KEYSPACE_NAME), addQuotes(streamName)); for (ColumnNameTypeValue column : columns) { insert.value(addQuotes(column.getColumn()), column.getValue()); } insert.value(addQuotes(timestampColumnName), UUIDs.timeBased()); return insert; } }
SaveToCassandraOperationsService { public Insert createInsertStatement(String streamName, List<ColumnNameTypeValue> columns, String timestampColumnName) { Insert insert = QueryBuilder.insertInto(addQuotes(STREAMING.STREAMING_KEYSPACE_NAME), addQuotes(streamName)); for (ColumnNameTypeValue column : columns) { insert.value(addQuotes(column.getColumn()), column.getValue()); } insert.value(addQuotes(timestampColumnName), UUIDs.timeBased()); return insert; } SaveToCassandraOperationsService(Session session); }
SaveToCassandraOperationsService { public Insert createInsertStatement(String streamName, List<ColumnNameTypeValue> columns, String timestampColumnName) { Insert insert = QueryBuilder.insertInto(addQuotes(STREAMING.STREAMING_KEYSPACE_NAME), addQuotes(streamName)); for (ColumnNameTypeValue column : columns) { insert.value(addQuotes(column.getColumn()), column.getValue()); } insert.value(addQuotes(timestampColumnName), UUIDs.timeBased()); return insert; } SaveToCassandraOperationsService(Session session); Boolean check(); void refreshTablenames(); void checkKeyspace(); void createKeyspace(String keyspaceName); void createTable(String tableName, List<ColumnNameTypeValue> columns, String timestampColumnName); Insert createInsertStatement(String streamName, List<ColumnNameTypeValue> columns, String timestampColumnName); void alterTable(String streamName, Set<String> oldColumnNames, List<ColumnNameTypeValue> columns); HashMap<String, Integer> getTableNames(); Session getSession(); }
SaveToCassandraOperationsService { public Insert createInsertStatement(String streamName, List<ColumnNameTypeValue> columns, String timestampColumnName) { Insert insert = QueryBuilder.insertInto(addQuotes(STREAMING.STREAMING_KEYSPACE_NAME), addQuotes(streamName)); for (ColumnNameTypeValue column : columns) { insert.value(addQuotes(column.getColumn()), column.getValue()); } insert.value(addQuotes(timestampColumnName), UUIDs.timeBased()); return insert; } SaveToCassandraOperationsService(Session session); Boolean check(); void refreshTablenames(); void checkKeyspace(); void createKeyspace(String keyspaceName); void createTable(String tableName, List<ColumnNameTypeValue> columns, String timestampColumnName); Insert createInsertStatement(String streamName, List<ColumnNameTypeValue> columns, String timestampColumnName); void alterTable(String streamName, Set<String> oldColumnNames, List<ColumnNameTypeValue> columns); HashMap<String, Integer> getTableNames(); Session getSession();  }