Package com.dianping.cat.message

Examples of com.dianping.cat.message.MessageProducer.newTransaction()


    if (len > 0) {
      Cat.setup("DumpUploader");

      MessageProducer cat = Cat.getProducer();
      String ip = NetworkInterfaceManager.INSTANCE.getLocalHostAddress();
      Transaction root = cat.newTransaction("System", "Dump-" + ip);

      Collections.sort(paths);

      root.addData("files", paths);
      root.setStatus(Message.SUCCESS);
View Full Code Here


      root.addData("files", paths);
      root.setStatus(Message.SUCCESS);

      for (int i = 0; i < len; i++) {
        String path = paths.get(i);
        Transaction t = cat.newTransaction("System", "UploadDump");
        File file = new File(baseDir, path);

        t.addData("file", path);

        FSDataOutputStream fdos = null;
View Full Code Here

    if (!m_serverConfigManager.isHdfsOn()) {
      return null;
    }

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

    t.setStatus(Message.SUCCESS);

    try {
      MessageId id = MessageId.parse(messageId);
View Full Code Here

public class CatEnvironmentTest {
  @Test
  public void testWithoutInitialize() throws InterruptedException {
    MessageProducer cat = Cat.getProducer();
    Transaction t = cat.newTransaction("TestType", "TestName");

    t.addData("data here");
    t.setStatus("TestStatus");
    t.complete();
View Full Code Here

  @Test
  public void testWithInitialize() throws InterruptedException {
    Cat.initialize(new File("/data/appdatas/cat/client.xml"));
    MessageProducer cat = Cat.getProducer();
    Transaction t = cat.newTransaction("TestType", "TestName");

    t.addData("data here");
    t.setStatus("TestStatus");
    t.complete();
View Full Code Here

  @Test
  public void testWithNoExistGlobalConfigInitialize() throws InterruptedException {
    Cat.initialize(new File("/data/appdatas/cat/clientNoExist.xml"));
    MessageProducer cat = Cat.getProducer();
    Transaction t = cat.newTransaction("TestType", "TestName");

    t.addData("data here");
    t.setStatus("TestStatus");
    t.complete();
View Full Code Here

    m_queue = Reflects.forField().getDeclaredFieldValue(queue.getClass(), "m_queue", queue);
  }

  public void testNormal() throws Exception {
    MessageProducer producer = Cat.getProducer();
    Transaction t = producer.newTransaction("URL", "MyPage");

    try {
      // do your business here
      t.addData("k1", "v1");
      t.addData("k2", "v2");
View Full Code Here

  }

  @Test
  public void testNormal() throws Exception {
    MessageProducer producer = Cat.getProducer();
    Transaction t = producer.newTransaction("URL", "MyPage");

    try {
      // do your business here
      t.addData("k1", "v1");
      t.addData("k2", "v2");
View Full Code Here

    m_logger.info(String.format("Finishing %s tasks in period [%s, %s]", m_tasks.size(), df.format(startDate),
          df.format(endDate)));

    MessageProducer cat = Cat.getProducer();
    Transaction t = cat.newTransaction("Checkpoint", "RealtimeConsumer");

    try {
      for (PeriodTask task : m_tasks) {
        task.finish();
      }
View Full Code Here

    }
  }

  public void doCheckpoint() throws IOException {
    MessageProducer cat = Cat.getProducer();
    Transaction t = cat.newTransaction("Checkpoint", getClass().getSimpleName());

    try {
      long currentStartTime = getCurrentStartTime();
      Period period = m_periodManager.findPeriod(currentStartTime);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.