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


Java Message类代码示例

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


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

示例1: execute

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public Message.Response execute(QueryState state)
{
    List<String> cqlVersions = new ArrayList<String>();
    cqlVersions.add(QueryProcessor.CQL_VERSION.toString());

    List<String> compressions = new ArrayList<String>();
    if (FrameCompressor.SnappyCompressor.instance != null)
        compressions.add("snappy");
    // LZ4 is always available since worst case scenario it default to a pure JAVA implem.
    compressions.add("lz4");

    Map<String, List<String>> supported = new HashMap<String, List<String>>();
    supported.put(StartupMessage.CQL_VERSION, cqlVersions);
    supported.put(StartupMessage.COMPRESSION, compressions);

    return new SupportedMessage(supported);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:18,代码来源:OptionsMessage.java

示例2: execute

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public Message.Response execute(QueryState state)
{
    try
    {
        AuthenticatedUser user = DatabaseDescriptor.getAuthenticator().authenticate(credentials);
        state.getClientState().login(user);
        return new ReadyMessage();
    }
    catch (AuthenticationException e)
    {
        return ErrorMessage.fromException(e);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:14,代码来源:CredentialsMessage.java

示例3: execute

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public Message.Response execute(QueryState state)
{
    try
    {
        AuthenticatedUser user = DatabaseDescriptor.getAuthenticator().legacyAuthenticate(credentials);
        state.getClientState().login(user);
    }
    catch (AuthenticationException e)
    {
        return ErrorMessage.fromException(e);
    }

    return new ReadyMessage();
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:CredentialsMessage.java

示例4: testLargeBatchWithProtoV4

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
@Test
public void testLargeBatchWithProtoV4() throws Exception
{
    createTable("CREATE TABLE %s (pk int PRIMARY KEY, v text)");

    try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, Server.VERSION_4))
    {
        client.connect(false);

        QueryMessage query = new QueryMessage(createBatchStatement(DatabaseDescriptor.getBatchSizeWarnThreshold()), QueryOptions.DEFAULT);
        Message.Response resp = client.execute(query);
        assertEquals(1, resp.getWarnings().size());
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:ClientWarningsTest.java

示例5: testLargeBatchWithProtoV2

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
@Test
public void testLargeBatchWithProtoV2() throws Exception
{
    createTable("CREATE TABLE %s (pk int PRIMARY KEY, v text)");

    try (SimpleClient client = new SimpleClient(nativeAddr.getHostAddress(), nativePort, Server.VERSION_3))
    {
        client.connect(false);

        QueryMessage query = new QueryMessage(createBatchStatement(DatabaseDescriptor.getBatchSizeWarnThreshold()), QueryOptions.DEFAULT);
        Message.Response resp = client.execute(query);
        assertNull(resp.getWarnings());
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:15,代码来源:ClientWarningsTest.java

示例6: execute

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public Message.Response execute(QueryState state)
{
    List<String> cqlVersions = new ArrayList<String>();
    cqlVersions.add(QueryProcessor.CQL_VERSION.toString());

    List<String> compressions = new ArrayList<String>();
    if (FrameCompressor.SnappyCompressor.instance != null)
        compressions.add("snappy");

    Map<String, List<String>> supported = new HashMap<String, List<String>>();
    supported.put(StartupMessage.CQL_VERSION, cqlVersions);
    supported.put(StartupMessage.COMPRESSION, compressions);

    return new SupportedMessage(supported);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:16,代码来源:OptionsMessage.java

示例7: execute

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public Message.Response execute(QueryState state)
{
    try
    {
        state.getClientState().login(credentials);
        return new ReadyMessage();
    }
    catch (AuthenticationException e)
    {
        return ErrorMessage.fromException(e);
    }
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:13,代码来源:CredentialsMessage.java

示例8: ReadyMessage

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public ReadyMessage()
{
    super(Message.Type.READY);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:ReadyMessage.java

示例9: AuthChallenge

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public AuthChallenge(byte[] token)
{
    super(Message.Type.AUTH_CHALLENGE);
    this.token = token;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:AuthChallenge.java

示例10: ErrorMessage

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
private ErrorMessage(TransportException error)
{
    super(Message.Type.ERROR);
    this.error = error;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:ErrorMessage.java

示例11: AuthResponse

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public AuthResponse(byte[] token)
{
    super(Message.Type.AUTH_RESPONSE);
    this.token = token;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:AuthResponse.java

示例12: EventMessage

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public EventMessage(Event event)
{
    super(Message.Type.EVENT);
    this.event = event;
    this.setStreamId(-1);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:7,代码来源:EventMessage.java

示例13: OptionsMessage

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public OptionsMessage()
{
    super(Message.Type.OPTIONS);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:OptionsMessage.java

示例14: AuthSuccess

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
public AuthSuccess(byte[] token)
{
    super(Message.Type.AUTH_SUCCESS);
    this.token = token;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:AuthSuccess.java

示例15: CredentialsMessage

import org.apache.cassandra.transport.Message; //导入依赖的package包/类
private CredentialsMessage(Map<String, String> credentials)
{
    super(Message.Type.CREDENTIALS);
    this.credentials = credentials;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:6,代码来源:CredentialsMessage.java


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