Java Code Examples for org.apache.cassandra.db.marshal.AsciiType#instance()

The following examples show how to use org.apache.cassandra.db.marshal.AsciiType#instance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SSTableWriter.java    From learning-hadoop with Apache License 2.0 6 votes vote down vote up
/**
 * Initialization. Creates target directory if needed and establishes 
 * the writer
 * 
 * @throws Exception if a problem occurs
 */
public void init() throws Exception {
  File directory = new File(this.directory);

  if (!directory.exists()) {
    directory.mkdir();
  }
  try {
  	//TODO set parameter for null
    writer = new SSTableSimpleUnsortedWriter(directory, null, keyspace,
        columnFamily, AsciiType.instance, null, bufferSize);
  } catch (Throwable t) {
    throw new KettleException(
        "Failed to create SSTableSimpleUnsortedWriter", t);
  }
}
 
Example 2
Source File: CassandraTypeConverterTest.java    From debezium-incubator with Apache License 2.0 5 votes vote down vote up
@Test
public void testAscii() {
    DataType asciiType = DataType.ascii();
    AbstractType<?> convertedType = CassandraTypeConverter.convert(asciiType);

    AsciiType expectedType = AsciiType.instance;

    Assert.assertEquals(expectedType, convertedType);
}
 
Example 3
Source File: GeoShapeMapper.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
/**
 * Builds a new {@link GeoShapeMapper}.
 */
@JsonCreator
public GeoShapeMapper(@JsonProperty("max_levels") Integer maxLevels) {
    super(new AbstractType<?>[]{AsciiType.instance, UTF8Type.instance});
    this.maxLevels = maxLevels == null ? DEFAULT_MAX_LEVELS : maxLevels;
    this.grid = new GeohashPrefixTree(spatialContext, this.maxLevels);
}
 
Example 4
Source File: ColumnMapperBlob.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
/**
 * Builds a new {@link ColumnMapperBlob}.
 */
@JsonCreator
public ColumnMapperBlob() {
    super(new AbstractType<?>[]{AsciiType.instance, UTF8Type.instance, BytesType.instance}, new AbstractType[]{});
}
 
Example 5
Source File: ColumnMapperInet.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
/**
 * Builds a new {@link ColumnMapperInet}.
 */
@JsonCreator
public ColumnMapperInet() {
    super(new AbstractType<?>[]{AsciiType.instance, UTF8Type.instance, InetAddressType.instance},
          new AbstractType[]{});
}
 
Example 6
Source File: ColumnMapperBoolean.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
/**
 * Builds a new {@link ColumnMapperBlob}.
 */
@JsonCreator
public ColumnMapperBoolean() {
    super(new AbstractType<?>[]{AsciiType.instance, UTF8Type.instance, BooleanType.instance}, new AbstractType[]{});
}