com.google.code.or.binlog.impl..ReplicationBasedBinlogParser.swp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of open-replicator Show documentation
Show all versions of open-replicator Show documentation
Open Replicator is a high performance MySQL binlog parser written in Java.
b0VIM 7.4 ???V?ơ># ben alpha21 ~ben/src/open-replicator/src/main/java/com/google/code/or/binlog/impl/ReplicationBasedBinlogParser.java utf-8 3210 #"! U tp m r + z ad ? m ? ? m & ? ? Z W $ ! ?
?
I
? ? ? ? ? q p % ? ? ? r < ?
?
J
? ? ? ? ? ? u q ? ? ? ? ? ? ? ? ? ? d a ` U ( ? ? ? ? ? ? ? ? w t s B $ ! ? ? ? ? ? s p o " ? ? ? ? ? # ? ? ? ? | { X : 7 6 ? ? ? ? ? ? ? c a ! @ @Override */ * /** } return System.currentTimeMillis() - this.lastHeartbeatMillis; return null; if ( this.lastEv return null; if ( t return null; if ( this.lastEventMillis == null ) p return null; if ( this.lastEventMillis == null ) public Long millisSinceLastEvent() { } return this.heartbeatCount; public long getHeartbeatCount() { } } } throw new RuntimeException("assertion failed, invalid packet marker: " + packetMarker); } else { throw new RuntimeException(packet.toString()); final EOFPacket packet = EOFPacket.valueOf(ts.currentPacketLength(), ts.currentPacketSequence(), packetMarker, ts); } else if((byte)packetMarker == EOFPacket.PACKET_MARKER) { throw new RuntimeException(packet.toString()); final ErrorPacket packet = ErrorPacket.valueOf(ts.currentPacketLength(), ts.currentPacketSequence(), packetMarker, ts); if((byte)packetMarker == ErrorPacket.PACKET_MARKER) { if(packetMarker != OKPacket.PACKET_MARKER) { // 0x00 final int packetMarker = ts.readInt(1); private void readPacketMarker(TransportInputStream ts) throws IOException { } this.binlogFileName = binlogFileName; public void setBinlogFileName(String binlogFileName) { } return binlogFileName; public String getBinlogFileName() { @Override } this.transport = transport; public void setTransport(Transport transport) { } return transport; public Transport getTransport() { */ * /** } // NOP protected void doStop(long timeout, TimeUnit unit) throws Exception { @Override } // NOP protected void doStart() throws Exception { @Override } public ReplicationBasedBinlogParser() { */ * /** protected Transport transport; // protected Long lastEventMillis = null; protected long heartbeatCount = 0; private static final Logger LOGGER = LoggerFactory.getLogger(ReplicationBasedBinlogParser.class); // public class ReplicationBasedBinlogParser extends AbstractBinlogParser { */ * @author Jingqi Xu * /** import com.google.code.or.net.impl.packet.OKPacket; import com.google.code.or.net.impl.packet.ErrorPacket; import com.google.code.or.net.impl.packet.EOFPacket; import com.google.code.or.net.impl.EventInputStream; import com.google.code.or.net.TransportInputStream; import com.google.code.or.net.Transport; import com.google.code.or.io.XInputStream; import com.google.code.or.common.util.MySQLConstants; import com.google.code.or.binlog.impl.event.BinlogEventV4HeaderImpl; import com.google.code.or.binlog.BinlogEventParser; import org.slf4j.LoggerFactory; import org.slf4j.Logger; import com.google.code.or.binlog.impl.parser.FormatDescriptionEventParser; import java.util.concurrent.TimeUnit; import java.io.IOException; package com.google.code.or.binlog.impl; */ * limitations under the License. * See the License for the specific language governing permissions and * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * distributed under the License is distributed on an "AS IS" BASIS, * Unless required by applicable law or agreed to in writing, software * * http://www.apache.org/licenses/LICENSE-2.0 * * the License. You may obtain a copy of the License at * (the "License"); you may not use this file except in compliance with * The ASF licenses this file to You under the Apache License, Version 2.0 * this work for additional information regarding copyright ownership. * contributor license agreements. See the NOTICE file distributed with * Licensed to the Apache Software Foundation (ASF) under one or more /** ad ? ?
+ ? ? X W * ) ? ? ? ? H G ?
?
?
?
?
C
<
? ? ? ? k ' ? ? ? d = 8 7 6 ?
?
?
?
?
?
?
} }}} } } es.finishEvent(header); es.setChecksumEnabled(context.getChecksumEnabled()); if ( isFormatDescriptionEvent ) } parser.parse(es, header, context); if(parser == null) parser = this.defaultParser; BinlogEventParser parser = getEventParser(header.getEventType()); } else { this.defaultParser.parse(es, header, context); else new FormatDescriptionEventParser().parse(es, header, context); if ( isFormatDescriptionEvent ) */ we still need to know. checksum info -- if the caller has filtered them out, FORMAT_DESCRIPTION events must always be parsed to ensure that we record /* if(this.eventFilter != null && !this.eventFilter.accepts(header, context)) { // Parse the event body this.lastEventMillis = System.currentTimeMillis(); this.heartbeatCount++; if ( header.getEventType() == MySQLConstants.HEARTBEAT_LOG_EVENT ) boolean isFormatDescriptionEvent = header.getEventType() == MySQLConstants.FORMAT_DESCRIPTION_EVENT; header = es.getNextBinlogHeader(); readPacketMarker(is); while(isRunning()) { BinlogEventV4HeaderImpl header; final Context context = new Context(this); final EventInputStream es = new EventInputStream(is); final TransportInputStream is = this.transport.getInputStream(); protected void doParse() throws Exception { ad o ? ? ? ? ? ? ? ? ? ? p @Override */ * /** } ret @Override */ @Ov @Override */ * /** } return System.currentTimeMillis() - this.lastEventMillis;