Package com.dianping.cat.message.internal

Examples of com.dianping.cat.message.internal.MessageId


    Transaction t = cat.newTransaction("BucketService", getClass().getSimpleName());

    t.setStatus(Message.SUCCESS);

    try {
      MessageId id = MessageId.parse(messageId);
      final String path = m_pathBuilder.getPath(new Date(id.getTimestamp()), "");
      final StringBuilder sb = new StringBuilder();
      FileSystem fs = m_manager.getFileSystem("dump", sb);

      sb.append('/').append(path);

      final String key = id.getDomain() + '-' + id.getIpAddress();
      final String str = sb.toString();
      final Path basePath = new Path(str);
      final List<String> paths = new ArrayList<String>();

      fs.listStatus(basePath, new PathFilter() {
View Full Code Here


        }
      }
    }

    if (crossInfo.getRemoteAddress().equals(UNKNOWN)) {
      MessageId id = MessageId.parse(tree.getMessageId());
      String remoteIp = id.getIpAddress();

      crossInfo.setRemoteAddress(remoteIp);
    }

    crossInfo.setLocalAddress(localIp);
View Full Code Here

    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;
View Full Code Here

    throw new UnsupportedOperationException("This should not be called!");
  }

  @Override
  protected void process(MessageTree tree) {
    MessageId messageId = MessageId.parse(tree.getMessageId());
    String domain = tree.getDomain();

    if (messageId.getVersion() == 2) {
      try {
        long time = tree.getMessage().getTimestamp();
        long fixedTime = time - time % (60 * 60 * 1000);
        long idTime = messageId.getTimestamp();
        long duration = fixedTime - idTime;

        if (duration == 0 || duration == ONE_HOUR || duration == -ONE_HOUR) {
          m_bucketManager.storeMessage(tree, messageId);
        } else {
View Full Code Here

  public boolean isEligable(ModelRequest request) {
    boolean eligibale = !request.getPeriod().isCurrent();

    if (eligibale) {
      String messageId = request.getProperty("messageId");
      MessageId id = MessageId.parse(messageId);

      return id.getVersion() == 2;
    }

    return eligibale;
  }
View Full Code Here

  public boolean isEligable(ModelRequest request) {
    boolean eligibale = request.getPeriod().isCurrent();

    if (eligibale) {
      String messageId = request.getProperty("messageId");
      MessageId id = MessageId.parse(messageId);

      return id.getVersion() == 2;
    }

    return eligibale;
  }
View Full Code Here

        response = m_eventService.invoke(request);
      } else if (ProblemAnalyzer.ID.equals(report)) {
        response = m_problemService.invoke(request);
      } else if ("logview".equals(report)) {
        String messageId = payload.getMessageId();
        MessageId id = MessageId.parse(messageId);

        request.setProperty("messageId", messageId);
        request.setProperty("waterfall", String.valueOf(payload.isWaterfall()));

        if (id.getVersion() != 1) {
          response = m_messageService.invoke(request);
        }
      } else if (HeartbeatAnalyzer.ID.equals(report)) {
        response = m_heartbeatService.invoke(request);
      } else if (MatrixAnalyzer.ID.equals(report)) {
View Full Code Here

  private MessagePathBuilder m_pathBuilder;

  private String getLogView(String messageId, boolean waterfall) {
    try {
      if (messageId != null) {
        MessageId id = MessageId.parse(messageId);
        long timestamp = id.getTimestamp();
        ModelRequest request = new ModelRequest(id.getDomain(), timestamp) //
              .setProperty("messageId", messageId) //
              .setProperty("waterfall", String.valueOf(waterfall)) //
              .setProperty("timestamp", String.valueOf(timestamp));

        if (m_service.isEligable(request)) {
View Full Code Here

      return null;
    }
  }

  private String getPath(String messageId) {
    MessageId id = MessageId.parse(messageId);
    final String path = m_pathBuilder.getPath(new Date(id.getTimestamp()), "");
    final String key = id.getDomain() + '-' + id.getIpAddress();

    return path + key;
  }
View Full Code Here

    MessageIdFactory factory = getMessageIdFactory(ip, domain);

    for (int i = 0; i < m_num; i++) {
      String messageId = factory.getNextId();
      DefaultMessageTree tree = newMessageTree(messageId, i, m_now + i * 10L);
      MessageId id = MessageId.parse(tree.getMessageId());

      ChannelBuffer buf = ChannelBuffers.dynamicBuffer(512); // 8K
      m_codec.encode(tree, buf);

      tree.setBuffer(buf);
View Full Code Here

TOP

Related Classes of com.dianping.cat.message.internal.MessageId

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.