Package com.leansoft.logging.thrift

Examples of com.leansoft.logging.thrift.LogEvent


  static Random random = new Random();
  static ThreadLocalTSerializer tSerializer = new ThreadLocalTSerializer();
  static ThreadLocalTDeserializer tDeserializer = new ThreadLocalTDeserializer();
 
  public static LogEvent genRandomLogEvent(int maxMessageSize) {
    LogEvent logEvent = new LogEvent();
    logEvent.createdTime = System.currentTimeMillis();
    logEvent.hostId = "localhost";
    int value = random.nextInt(5);
    logEvent.logLevel = LogLevel.findByValue(value);
    int size = random.nextInt(maxMessageSize) + 1;
View Full Code Here


    logEvent.message = RandomStringUtil.genRandomString(size);
    return logEvent;
  }
 
  public static byte[] genRandomLogEventBytes(int maxMessageSize) throws TException {
    LogEvent logEvent = genRandomLogEvent(maxMessageSize);
    TSerializer localSerializer = tSerializer.get();
    return localSerializer.serialize(logEvent);
  }
View Full Code Here

    TSerializer localSerializer = tSerializer.get();
    return localSerializer.serialize(logEvent);
  }
 
  public LogEvent getLogEventFromBytes(byte[] data) throws TException {
    LogEvent logEvent = new LogEvent();
    TDeserializer localDeserializer = tDeserializer.get();
    localDeserializer.deserialize(logEvent, data);
    return logEvent;
  }
View Full Code Here

TOP

Related Classes of com.leansoft.logging.thrift.LogEvent

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.