本文整理汇总了Java中net.openhft.chronicle.Chronicle类的典型用法代码示例。如果您正苦于以下问题:Java Chronicle类的具体用法?Java Chronicle怎么用?Java Chronicle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Chronicle类属于net.openhft.chronicle包,在下文中一共展示了Chronicle类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Master
import net.openhft.chronicle.Chronicle; //导入依赖的package包/类
public Master() throws IOException {
String indexPath = Utils.prepareIndexDirectory(TEST_INDEX_DIRECTORY_PATH);
//int tenSeconds = 10 * 1000;
Chronicle build = ChronicleQueueBuilder.vanilla(indexPath).cycleLength(3600000).build();
m_chronicle = ChronicleQueueBuilder.source(build).bindAddress(PORT).build();
m_appender = m_chronicle.createAppender();
m_server = new Thread(new Runnable() {
@Override
public void run() {
m_chronicle.clear();
m_logger.info("start server");
for (long i = 1; i <= 1000000; i++) {
String msg = "test" + i;
m_logger.info("server stock:" + msg);
publish(msg.getBytes());
try {
Thread.sleep(500);
} catch (InterruptedException e) {
//
}
}
m_appender.close();
}
});
}
开发者ID:adioss,项目名称:ChronicleQueueDemo,代码行数:26,代码来源:Master.java
示例2: ChronicleDomainEventReader
import net.openhft.chronicle.Chronicle; //导入依赖的package包/类
/**
* c-tor
*
* @param chronicle the Chronicle
* @param serializer the DomainEventStream serializer
*/
public ChronicleDomainEventReader(Chronicle chronicle, Serializer serializer) {
m_serializer = serializer;
try {
m_excerpt = chronicle.createTailer();
} catch (Exception e) {
m_excerpt = null;
LOGGER.warn("CreateTailer - Exception",e);
}
}
开发者ID:lburgazzoli,项目名称:lb-axon,代码行数:17,代码来源:ChronicleDomainEventReader.java
示例3: ChronicleDomainEventWriter
import net.openhft.chronicle.Chronicle; //导入依赖的package包/类
/**
* c-tor
*
* @param chronicle the Chronicle
* @param serializer the DomainEventStream serializer
*/
public ChronicleDomainEventWriter(Chronicle chronicle, Serializer serializer) {
m_serializer = serializer;
try {
m_excerpt = chronicle.createAppender();
} catch (Exception e) {
m_excerpt = null;
LOGGER.warn("CreateAppender - Exception",e);
}
}
开发者ID:lburgazzoli,项目名称:lb-axon,代码行数:17,代码来源:ChronicleDomainEventWriter.java
示例4: commandLog
import net.openhft.chronicle.Chronicle; //导入依赖的package包/类
public static final CommandLog commandLog(final int serverId, final String name) throws IOException {
final String path = Files.fileDirectory();
final String child = Files.fileName(serverId, name);
final Chronicle chronicle = ChronicleQueueBuilder.vanilla(path, child).build();
return new ChronicleCommandLog((VanillaChronicle)chronicle, new ExpandableArrayBuffer(INITIAL_BUFFER_SIZE));
}
开发者ID:terzerm,项目名称:hover-raft,代码行数:7,代码来源:Files.java
示例5: init
import net.openhft.chronicle.Chronicle; //导入依赖的package包/类
protected void init(final Chronicle chronicle) {
m_chronicle = chronicle;
m_writer = new ChronicleDomainEventWriter<>(m_chronicle, m_serializer);
}
开发者ID:lburgazzoli,项目名称:lb-axon,代码行数:5,代码来源:ChronicleDomainEventStore.java
注:本文中的net.openhft.chronicle.Chronicle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论