• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Message类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SupportedMessage

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


示例17: AuthenticateMessage

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CompileTester类代码示例发布时间:2022-05-22
下一篇:
Java HTMLTransfer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap