Examples of TTLogBlock


Examples of com.alibaba.tt.log.impl.TTLogBlock

    private final static int NEW_ENTRIES_COUNT = 20;

  public TTLogBlock readBlock()
  {
    TTLogBlock block = null;
    try {
      block = _inStreamInput.read();
    } catch (Throwable e) {
      LOG.error("ttreaderror",e);
      block=null;
View Full Code Here

Examples of com.alibaba.tt.log.impl.TTLogBlock

    return block;
  }
  @Override
  public List<Object> read() throws IOException {

    TTLogBlock block = this.readBlock();
    if (block == null) {
      return null;
    }
    // ack
    MessageKey key = block.getKey();
    key.ack();

    List<Object> list = new ArrayList<Object>(NEW_ENTRIES_COUNT);
    String buffer = new String(block.getBuffer());
    for (String mesgStr : buffer.split("[\n\r]", -1)) {
      list.add(mesgStr);
    }
    return list;
View Full Code Here

Examples of com.alibaba.tt.log.impl.TTLogBlock

public class AplusTT4Reader extends TT4Reader {

  @Override
  public List<Object> read() throws IOException {

    TTLogBlock block = this.readBlock();
    if (block == null) {
      return null;
    }
   
    // ack
    MessageKey key = block.getKey();
    key.ack();
   
    byte[] data=block.getBuffer();
   
    List<byte[]> messages = MessageParser.parseProtoBufsFromBytes(data);
    List<Object> list = new ArrayList<Object>(1);
    if(messages!=null)
    {
View Full Code Here

Examples of com.alibaba.tt.log.impl.TTLogBlock

    @Override
    public List<String> read()
        throws IOException
    {
 
          TTLogBlock block = null;
          try {
              block = _inStreamInput.read();
          } catch (IndexOutOfBoundsException e) {
              e.printStackTrace();
          } catch (TTQueueException e) {
              e.printStackTrace();
          } catch (TTQueueSafemodeException e) {
              e.printStackTrace();
          } catch (TTSubChangedException e) {
              e.printStackTrace();
          }
          if (block == null){
              return null;
          }
          // ack
          MessageKey key = block.getKey();
          key.ack();
 
          List<String> list = new ArrayList<String>(NEW_ENTRIES_COUNT);
          String buffer = new String(block.getBuffer());
          for (String mesgStr: buffer.split("[\n\r]", -1)){
              list.add(mesgStr);
          }
          return list;
   
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.