当前位置: 首页>>代码示例>>Java>>正文


Java InvalidConfigurationInQueryException类代码示例

本文整理汇总了Java中com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException的典型用法代码示例。如果您正苦于以下问题:Java InvalidConfigurationInQueryException类的具体用法?Java InvalidConfigurationInQueryException怎么用?Java InvalidConfigurationInQueryException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InvalidConfigurationInQueryException类属于com.datastax.driver.core.exceptions包,在下文中一共展示了InvalidConfigurationInQueryException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkCassandraException

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
protected void checkCassandraException(Exception e) {
    _mexceptions.incr();
    if (e instanceof AlreadyExistsException ||
            e instanceof AuthenticationException ||
            e instanceof DriverException ||
            e instanceof DriverInternalError ||
            e instanceof InvalidConfigurationInQueryException ||
            e instanceof InvalidQueryException ||
            e instanceof InvalidTypeException ||
            e instanceof QueryExecutionException ||
            e instanceof QueryTimeoutException ||
            e instanceof QueryValidationException ||
            e instanceof ReadTimeoutException ||
            e instanceof SyntaxError ||
            e instanceof TraceRetrievalException ||
            e instanceof TruncateException ||
            e instanceof UnauthorizedException ||
            e instanceof UnavailableException ||
            e instanceof ReadTimeoutException ||
            e instanceof WriteTimeoutException) {
        throw new ReportedFailedException(e);
    } else {
        throw new RuntimeException(e);
    }
}
 
开发者ID:hpcc-systems,项目名称:storm-cassandra-cql,代码行数:26,代码来源:CassandraCqlMapState.java

示例2: testShouldReturnConfigurationError

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
@Test
public void testShouldReturnConfigurationError() throws Exception {
  String message = "This is a config error";
  server.prime(when(query).then(configurationError(message)));

  thrown.expect(InvalidConfigurationInQueryException.class);
  thrown.expectMessage(endsWith(message));
  query();
}
 
开发者ID:datastax,项目名称:simulacron,代码行数:10,代码来源:ErrorResultIntegrationTest.java

示例3: testInValidCreateIndex

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
@Test
public void testInValidCreateIndex() {
    String createIndexQuery = "CREATE CUSTOM INDEX " +
                              TestingConstants.INDEX_NAME_CONSTANT +
                              " ON " +
                              cassandraUtils.getKeyspace() +
                              "." +
                              cassandraUtils.getTable() +
                              "(lucene) " +
                              "USING 'com.stratio.cassandra.lucene.Index' " +
                              "WITH OPTIONS = { " +
                              "'refresh_seconds' : '1', " +
                              "'schema' : '{ " +
                              " fields : { " +
                              " \"addres.inexistent.latitude\" : {type:\"string\"}}}'};";

    try {
        cassandraUtils.executeQuery(createIndexQuery);
        assertFalse("Creating invalid index must throw an Exception but does not ", true);
    } catch (InvalidConfigurationInQueryException e) {
        String expectedMessage = "'schema' is invalid : No column definition 'addres.inexistent' for mapper 'addres.inexistent.latitude'";
        assertEquals("Cretaing invalid index must return InvalidConfigurationInQueryException(" +
                     expectedMessage +
                     ") but returns InvalidConfigurationInQueryException(" +
                     e.getMessage() +
                     ")", expectedMessage, e.getMessage());

    }
}
 
开发者ID:Stratio,项目名称:stratio-cassandra-test,代码行数:30,代码来源:UDTValidationTest.java

示例4: testInValidCreateIndex2

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
@Test
public void testInValidCreateIndex2() {
    String createIndexQuery = "CREATE CUSTOM INDEX " +
                              TestingConstants.INDEX_NAME_CONSTANT +
                              " ON " +
                              cassandraUtils.getKeyspace() +
                              "." +
                              cassandraUtils.getTable() +
                              "(lucene) " +
                              "USING 'com.stratio.cassandra.lucene.Index' " +
                              "WITH OPTIONS = { " +
                              "'refresh_seconds' : '1', " +
                              "'schema' : '{ " +
                              " fields : { " +
                              "\"addres.inexistent\" : {type:\"string\"}}}'};";

    try {
        cassandraUtils.executeQuery(createIndexQuery);
        assertFalse("Creating invalid index must throw an Exception but does not ", true);
    } catch (InvalidConfigurationInQueryException e) {
        String expectedMessage = "'schema' is invalid : No column definition 'addres.inexistent' for mapper 'addres.inexistent'";
        assertEquals("Cretaing invalid index must return InvalidConfigurationInQueryException(" +
                     expectedMessage +
                     ") but returns InvalidConfigurationInQueryException(" +
                     e.getMessage() +
                     ")", expectedMessage, e.getMessage());

    }
}
 
开发者ID:Stratio,项目名称:stratio-cassandra-test,代码行数:30,代码来源:UDTValidationTest.java

示例5: testInValidCreateIndex3

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
@Test
public void testInValidCreateIndex3() {
    String createIndexQuery = "CREATE CUSTOM INDEX " +
                              TestingConstants.INDEX_NAME_CONSTANT +
                              " ON " +
                              cassandraUtils.getKeyspace() +
                              "." +
                              cassandraUtils.getTable() +
                              "(lucene) " +
                              "USING 'com.stratio.cassandra.lucene.Index' " +
                              "WITH OPTIONS = { " +
                              "'refresh_seconds' : '1', " +
                              "'schema' : '{ " +
                              " fields : { " +
                              "\"addres.city\" : {type:\"string\"}," +
                              "\"addres.zip\" : {type:\"integer\"}," +
                              "\"addres.bool\" : {type:\"boolean\"}," +
                              "\"addres.hight\" : {type:\"float\"}," +
                              "\"addres.point.latitude\" : {type:\"float\"}," +
                              "\"addres.point.longitude\" : {type:\"bytes\"}," +
                              "first_name : {type:\"string\"}}}'};";

    try {
        cassandraUtils.executeQuery(createIndexQuery);
        assertFalse("Creating invalid index must throw an Exception but does not ", true);
    } catch (InvalidConfigurationInQueryException e) {
        String expectedMessage = "'schema' is invalid : 'org.apache.cassandra.db.marshal.FloatType' is not supported by mapper 'addres.point.longitude'";
        assertEquals("Cretaing invalid index must return InvalidConfigurationInQueryException(" +
                     expectedMessage +
                     ") but returns InvalidConfigurationInQueryException(" +
                     e.getMessage() +
                     ")", expectedMessage, e.getMessage());

    }
}
 
开发者ID:Stratio,项目名称:stratio-cassandra-test,代码行数:36,代码来源:UDTValidationTest.java

示例6: testInValidCreateIndex4

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
@Test
public void testInValidCreateIndex4() {
    String createIndexQuery = "CREATE CUSTOM INDEX " +
                              TestingConstants.INDEX_NAME_CONSTANT +
                              " ON " +
                              cassandraUtils.getKeyspace() +
                              "." +
                              cassandraUtils.getTable() +
                              "(lucene) " +
                              "USING 'com.stratio.cassandra.lucene.Index' " +
                              "WITH OPTIONS = { " +
                              "'refresh_seconds' : '1', " +
                              "'schema' : '{ " +
                              " fields : { " +
                              "\"addres.city\" : {type:\"string\"}," +
                              "\"addres.zip\" : {type:\"integer\"}," +
                              "\"addres.bool\" : {type:\"boolean\"}," +
                              "\"addres.hight\" : {type:\"float\"}," +
                              "\"addres.point.latitude\" : {type:\"float\"}," +
                              "\"addres.point.longitude.inexistent\" : {type:\"float\"}," +
                              "first_name : {type:\"string\"}}}'};";

    try {
        cassandraUtils.executeQuery(createIndexQuery);
        assertFalse("Creating invalid index must throw an Exception but does not ", true);
    } catch (InvalidConfigurationInQueryException e) {
        String expectedMessage = "'schema' is invalid : No column definition 'addres.point.longitude.inexistent' for mapper 'addres.point.longitude.inexistent'";
        assertEquals("Cretaing invalid index must return InvalidConfigurationInQueryException(" +
                     expectedMessage +
                     ") but returns InvalidConfigurationInQueryException(" +
                     e.getMessage() +
                     ")", expectedMessage, e.getMessage());

    }
}
 
开发者ID:Stratio,项目名称:stratio-cassandra-test,代码行数:36,代码来源:UDTValidationTest.java

示例7: revertCompressionChunkLength

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
private void revertCompressionChunkLength() throws Exception {
    try {
        // try with compression options for Cassandra 3.x
        // see https://docs.datastax.com/en/cql/3.3/cql/cql_reference/compressSubprop.html
        session.execute("alter table trace_entry with compression = {'class':"
                + " 'org.apache.cassandra.io.compress.LZ4Compressor', 'chunk_length_kb' :"
                + " 64};");
    } catch (InvalidConfigurationInQueryException e) {
        logger.debug(e.getMessage(), e);
        // try with compression options for Cassandra 2.x
        // see https://docs.datastax.com/en/cql/3.1/cql/cql_reference/compressSubprop.html
        session.execute("alter table trace_entry with compression"
                + " = {'sstable_compression': 'SnappyCompressor', 'chunk_length_kb' : 64};");
    }
}
 
开发者ID:glowroot,项目名称:glowroot,代码行数:16,代码来源:SchemaUpgrade.java

示例8: createTableWithTWCS

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
public void createTableWithTWCS(String createTableQuery, int expirationHours,
        boolean useAndInsteadOfWith, boolean fallbackToSTCS) {
    // as long as gc_grace_seconds is less than TTL, then tombstones can be collected
    // immediately (https://issues.apache.org/jira/browse/CASSANDRA-4917)
    //
    // not using gc_grace_seconds of 0 since that disables hinted handoff
    // (http://www.uberobert.com/cassandra_gc_grace_disables_hinted_handoff)
    //
    // it seems any value over max_hint_window_in_ms (which defaults to 3 hours) is good
    long gcGraceSeconds = HOURS.toSeconds(4);

    // using unchecked_tombstone_compaction=true for better tombstone purging
    // see http://thelastpickle.com/blog/2016/12/08/TWCS-part1.html
    String term = useAndInsteadOfWith ? "and" : "with";
    try {
        wrappedSession.execute(createTableQuery + " " + term + " compaction = { 'class' :"
                + " 'TimeWindowCompactionStrategy', 'compaction_window_unit' : 'HOURS',"
                + " 'compaction_window_size' : '"
                + getCompactionWindowSizeHours(expirationHours)
                + "', 'unchecked_tombstone_compaction' : true } and gc_grace_seconds = "
                + gcGraceSeconds);
    } catch (InvalidConfigurationInQueryException e) {
        logger.debug(e.getMessage(), e);
        if (fallbackToSTCS) {
            wrappedSession.execute(createTableQuery + " " + term
                    + " compaction = { 'class' : 'SizeTieredCompactionStrategy',"
                    + " 'unchecked_tombstone_compaction' : true } and gc_grace_seconds = "
                    + gcGraceSeconds);
        } else {
            wrappedSession.execute(createTableQuery + " " + term
                    + " compaction = { 'class' : 'DateTieredCompactionStrategy',"
                    + " 'unchecked_tombstone_compaction' : true } and gc_grace_seconds = "
                    + gcGraceSeconds);
        }
    }
}
 
开发者ID:glowroot,项目名称:glowroot,代码行数:37,代码来源:Session.java

示例9: toResponse

import com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException; //导入依赖的package包/类
public Response toResponse(InvalidConfigurationInQueryException exception) {
	LOG.error("foo", exception);
    return Response.status(Status.NOT_FOUND).entity(exception.getCause()).build();
}
 
开发者ID:boneill42,项目名称:memnon,代码行数:5,代码来源:KeyspaceExceptionMapper.java


注:本文中的com.datastax.driver.core.exceptions.InvalidConfigurationInQueryException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。