Package com.dianping.cat.storage.dump

Examples of com.dianping.cat.storage.dump.LocalMessageBucketManager


  }

  @Test
  @Ignore
  public void testReadWrite() throws Exception {
    LocalMessageBucketManager localManager = (LocalMessageBucketManager) lookup(MessageBucketManager.class,
          LocalMessageBucketManager.ID);
    MessageBucketManager hdfsManager = lookup(MessageBucketManager.class, HdfsMessageBucketManager.ID);
    MessageIdFactory factory = new MockMessageIdFactory();
    long now = 1343532130488L;
    int num = 100;

    factory.setIpAddress("7f000001");
    factory.initialize("source");
    localManager.setBaseDir(new File("target/bucket/hdfs/dump")); // make local and hdfs base dir same

    for (int i = 0; i < num; i++) {
      MessageTree tree = newMessageTree(factory.getNextId(), i, now + i * 10L);
      MessageId id = MessageId.parse(tree.getMessageId());
      localManager.storeMessage(tree,id);
    }

    for (int i = 0; i < num; i++) {
      String messageId = "source-7f000001-373203-" + i;
      MessageTree tree = hdfsManager.loadMessage(messageId);
View Full Code Here

TOP

Related Classes of com.dianping.cat.storage.dump.LocalMessageBucketManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.