Package com.google.code.or.binlog.impl.event

Examples of com.google.code.or.binlog.impl.event.QueryEvent


    }

    // Beginning of Txn
    if (event instanceof QueryEvent)
    {
      QueryEvent qe = (QueryEvent)event;
      String sql = qe.getSql().toString();
      if ("BEGIN".equalsIgnoreCase(sql))
      {
        _isBeginTxnSeen = true;
        _log.info("BEGIN sql: " + sql);
        _currTxnSizeInBytes = event.getHeader().getEventLength();
        startXtion(qe);
        return;
      }
    }

    if ( ! _isBeginTxnSeen )
    {
      if (_log.isDebugEnabled())
      {
        _log.debug("Skipping event (" + event
            + ") as this is before the start of first transaction");
      }
      return;
    }

    _currTxnSizeInBytes += event.getHeader().getEventLength();

    if (event instanceof QueryEvent)
    {
      QueryEvent qe = (QueryEvent)event;
      String sql = qe.getSql().toString();
      if ("COMMIT".equalsIgnoreCase(sql))
      {
        _log.debug("COMMIT sql: " + sql);
        endXtion(qe);
        return;
View Full Code Here


  /**
   *
   */
  public void parse(XInputStream is, BinlogEventV4Header header, BinlogParserContext context)
  throws IOException {
    final QueryEvent event = new QueryEvent(header);
    event.setThreadId(is.readLong(4));
    event.setElapsedTime(is.readLong(4));
    event.setDatabaseNameLength(is.readInt(1));
    event.setErrorCode(is.readInt(2));
    event.setStatusVariablesLength(is.readInt(2));
    event.setStatusVariables(parseStatusVariables(is.readBytes(event.getStatusVariablesLength())));
    event.setDatabaseName(is.readNullTerminatedString());
    event.setSql(is.readFixedLengthString(is.available()));
    context.getEventListener().onEvents(event);
  }
View Full Code Here

TOP

Related Classes of com.google.code.or.binlog.impl.event.QueryEvent

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.