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


Java BytesStreamInput类代码示例

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


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

示例1: serialization

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
@Test
public void serialization() throws IOException {
	NodeIncrementalUpdateResponse[] nodes = new NodeIncrementalUpdateResponse[] {
			new NodeIncrementalUpdateResponse(new DiscoveryNode("nd1", DummyTransportAddress.INSTANCE, Version.CURRENT),
					false, false, null),
			new NodeIncrementalUpdateResponse(new DiscoveryNode("nd2", DummyTransportAddress.INSTANCE, Version.CURRENT),
					false, false, null),
			new NodeIncrementalUpdateResponse(new DiscoveryNode("nd3", DummyTransportAddress.INSTANCE, Version.CURRENT),
					true, true, "ORG") };
	IncrementalUpdateResponse testedSrc = new IncrementalUpdateResponse(new ClusterName("cl"), nodes);

	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);

	IncrementalUpdateResponse testedTarget = new IncrementalUpdateResponse();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));

	Assert.assertEquals(3, testedTarget.getNodes().length);
	NodeIncrementalUpdateResponse r = testedTarget.getSuccessNodeResponse();
	Assert.assertNotNull(r);
	Assert.assertEquals("nd3", r.getNode().getId());
	Assert.assertTrue(r.isRiverFound());
	Assert.assertTrue(r.spaceFound);
	Assert.assertEquals("ORG", r.reindexedSpaces);
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:26,代码来源:IncrementalUpdateResponseTest.java

示例2: serialization

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
@Test
public void serialization() throws IOException {
	NodeFullUpdateResponse[] nodes = new NodeFullUpdateResponse[] {
			new NodeFullUpdateResponse(new DiscoveryNode("nd1", DummyTransportAddress.INSTANCE, Version.CURRENT), false, false, null),
			new NodeFullUpdateResponse(new DiscoveryNode("nd2", DummyTransportAddress.INSTANCE, Version.CURRENT), false, false, null),
			new NodeFullUpdateResponse(new DiscoveryNode("nd3", DummyTransportAddress.INSTANCE, Version.CURRENT), true, true, "ORG") };
	FullUpdateResponse testedSrc = new FullUpdateResponse(new ClusterName("cl"), nodes);

	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);

	FullUpdateResponse testedTarget = new FullUpdateResponse();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));

	Assert.assertEquals(3, testedTarget.getNodes().length);
	NodeFullUpdateResponse r = testedTarget.getSuccessNodeResponse();
	Assert.assertNotNull(r);
	Assert.assertEquals("nd3", r.getNode().getId());
	Assert.assertTrue(r.isRiverFound());
	Assert.assertTrue(r.spaceFound);
	Assert.assertEquals("ORG", r.reindexedSpaces);
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:23,代码来源:FullUpdateResponseTest.java

示例3: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private NodeJRLifecycleResponse performSerializationAndBasicAsserts(NodeJRLifecycleResponse testedSrc)
    throws IOException {
  BytesStreamOutput out = new BytesStreamOutput();
  testedSrc.writeTo(out);
  NodeJRLifecycleResponse testedTarget = new NodeJRLifecycleResponse();
  testedTarget.readFrom(new BytesStreamInput(out.bytes()));
  Assert.assertEquals(testedSrc.getNode().getId(), testedTarget.getNode().getId());
  Assert.assertEquals(testedSrc.isRiverFound(), testedTarget.isRiverFound());

  return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:12,代码来源:NodeJRLifecycleResponseTest.java

示例4: performserialization

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
/**
 * @param testedSrc
 * @return
 * @throws IOException
 */
private JRLifecycleRequest performserialization(JRLifecycleRequest testedSrc) throws IOException {
  BytesStreamOutput out = new BytesStreamOutput();
  testedSrc.writeTo(out);
  JRLifecycleRequest testedTarget = new JRLifecycleRequest();
  testedTarget.readFrom(new BytesStreamInput(out.bytes()));
  return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:13,代码来源:JRLifecycleRequestTest.java

示例5: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private NodeJRLifecycleRequest performSerializationAndBasicAsserts(NodeJRLifecycleRequest testedSrc)
    throws IOException {
  BytesStreamOutput out = new BytesStreamOutput();
  testedSrc.writeTo(out);
  NodeJRLifecycleRequest testedTarget = new NodeJRLifecycleRequest();
  testedTarget.readFrom(new BytesStreamInput(out.bytes()));
  Assert.assertEquals(testedSrc.getRequest().getRiverName(), testedTarget.getRequest().getRiverName());
  Assert.assertEquals(testedSrc.getRequest().getCommand(), testedTarget.getRequest().getCommand());

  return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:12,代码来源:NodeJRLifecycleRequestTest.java

示例6: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private JRLifecycleResponse performSerializationAndBasicAsserts(JRLifecycleResponse testedSrc) throws IOException {
	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);
	JRLifecycleResponse testedTarget = new JRLifecycleResponse();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));

	Assert.assertEquals(testedSrc.getClusterName(), testedTarget.getClusterName());
	Assert.assertEquals(testedSrc.getNodes().length, testedTarget.getNodes().length);

	return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:12,代码来源:JRLifecycleResponseTest.java

示例7: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private NodeJRStateRequest performSerializationAndBasicAsserts(NodeJRStateRequest testedSrc) throws IOException {
  BytesStreamOutput out = new BytesStreamOutput();
  testedSrc.writeTo(out);
  NodeJRStateRequest testedTarget = new NodeJRStateRequest();
  testedTarget.readFrom(new BytesStreamInput(out.bytes()));
  Assert.assertEquals(testedSrc.getRequest().getRiverName(), testedTarget.getRequest().getRiverName());
  return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:9,代码来源:NodeJRStateRequestTest.java

示例8: performserialization

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
/**
 * @param testedSrc
 * @return
 * @throws IOException
 */
private JRStateRequest performserialization(JRStateRequest testedSrc) throws IOException {
  BytesStreamOutput out = new BytesStreamOutput();
  testedSrc.writeTo(out);
  JRStateRequest testedTarget = new JRStateRequest();
  testedTarget.readFrom(new BytesStreamInput(out.bytes()));
  return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:13,代码来源:JRStateRequestTest.java

示例9: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private NodeJRStateResponse performSerializationAndBasicAsserts(NodeJRStateResponse testedSrc) throws IOException {
  BytesStreamOutput out = new BytesStreamOutput();
  testedSrc.writeTo(out);
  NodeJRStateResponse testedTarget = new NodeJRStateResponse();
  testedTarget.readFrom(new BytesStreamInput(out.bytes()));
  Assert.assertEquals(testedSrc.getNode().getId(), testedTarget.getNode().getId());
  Assert.assertEquals(testedSrc.isRiverFound(), testedTarget.isRiverFound());
  Assert.assertEquals(testedSrc.stateInformation, testedTarget.stateInformation);
  return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:11,代码来源:NodeJRStateResponseTest.java

示例10: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private JRStateResponse performSerializationAndBasicAsserts(JRStateResponse testedSrc) throws IOException {
	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);
	JRStateResponse testedTarget = new JRStateResponse();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));

	Assert.assertEquals(testedSrc.getClusterName(), testedTarget.getClusterName());
	Assert.assertEquals(testedSrc.getNodes().length, testedTarget.getNodes().length);

	return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:12,代码来源:JRStateResponseTest.java

示例11: performserialization

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
/**
 * @param testedSrc
 * @return
 * @throws IOException
 */
private IncrementalUpdateRequest performserialization(IncrementalUpdateRequest testedSrc) throws IOException {
	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);
	IncrementalUpdateRequest testedTarget = new IncrementalUpdateRequest();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));
	return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:13,代码来源:IncrementalUpdateRequestTest.java

示例12: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private NodeIncrementalUpdateResponse performSerializationAndBasicAsserts(NodeIncrementalUpdateResponse testedSrc)
		throws IOException {
	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);
	NodeIncrementalUpdateResponse testedTarget = new NodeIncrementalUpdateResponse();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));
	Assert.assertEquals(testedSrc.getNode().getId(), testedTarget.getNode().getId());
	Assert.assertEquals(testedSrc.isRiverFound(), testedTarget.isRiverFound());
	Assert.assertEquals(testedSrc.spaceFound, testedTarget.spaceFound);
	Assert.assertEquals(testedSrc.reindexedSpaces, testedTarget.reindexedSpaces);
	return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:13,代码来源:NodeIncrementalUpdateResponseTest.java

示例13: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private NodeIncrementalUpdateRequest performSerializationAndBasicAsserts(NodeIncrementalUpdateRequest testedSrc)
		throws IOException {
	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);
	NodeIncrementalUpdateRequest testedTarget = new NodeIncrementalUpdateRequest();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));
	Assert.assertEquals(testedSrc.getRequest().getRiverName(), testedTarget.getRequest().getRiverName());
	Assert.assertEquals(testedSrc.getRequest().getSpaceKey(), testedTarget.getRequest().getSpaceKey());

	return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:12,代码来源:NodeIncrementalUpdateRequestTest.java

示例14: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private NodeListRiversResponse performSerializationAndBasicAsserts(NodeListRiversResponse testedSrc)
		throws IOException {
	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);
	NodeListRiversResponse testedTarget = new NodeListRiversResponse();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));
	Assert.assertEquals(testedSrc.getNode().getId(), testedTarget.getNode().getId());
	Assert.assertEquals(testedSrc.getRiverNames(), testedTarget.getRiverNames());

	return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:12,代码来源:NodeListRiversResponseTest.java

示例15: performSerializationAndBasicAsserts

import org.elasticsearch.common.io.stream.BytesStreamInput; //导入依赖的package包/类
private ListRiversResponse performSerializationAndBasicAsserts(ListRiversResponse testedSrc) throws IOException {
	BytesStreamOutput out = new BytesStreamOutput();
	testedSrc.writeTo(out);
	ListRiversResponse testedTarget = new ListRiversResponse();
	testedTarget.readFrom(new BytesStreamInput(out.bytes()));

	Assert.assertEquals(testedSrc.getClusterName(), testedTarget.getClusterName());
	Assert.assertEquals(testedSrc.getNodes().length, testedTarget.getNodes().length);

	return testedTarget;
}
 
开发者ID:searchisko,项目名称:elasticsearch-river-remote,代码行数:12,代码来源:ListRiversResponseTest.java


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