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 I?V{4@?/ ben alpha21 ~ben/src/open-replicator/src/main/java/com/google/code/or/binlog/impl/ReplicationBasedBinlogParser.java utf-8
3210 #"! U tp p r ad 9 p ? ? j " ? ? S O ?
?
<
? ? ? ? ? ? ] [ ? ? ? ? W ?
?
?
_
)
? ? ? ? ? ? ? L G ? ? ? ? ? ? ? ? ? | x v j < 2 . , ? ? ? ? ? ? ? ? ~ z x F ' # ! ? ? ? ? ? m i g ? ? | ? ? ? ? ? u o j f d ^ Y S G ? ? ? l j G / readPacket 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 {
@Override
*/
*
/**
}
}
}
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;
//
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 ? Z ? ? n l P ? ? ? l O F ! ?
?
?
?
I
? ? ? ? ? ? ? f a ] Z B ) ? t Q K D ?
?
?
Z
? ? ? ? S ? ? ? c : ? ? u o h ` ? ? Y ? { ? ? ? ? ? Y ,
}
}
}
}
}}
}
}
es.fin}
}
}
es.finishEvent(header);
}
}
}
es.finishEvent(header);
e}
}
}
es.finishEvent(header);
es.setChecksumEnable}
}
}
}
}
}
}
es.finishEvent(header);
}
}
}
es.finishEvent(header);
es.setChecks}
}
}
es.finishEvent(header);
es.setChecksum}
}
}
es.finishEvent(header);
es.setChecksumEnabled(context.getChecksumEnabled());
}
}
}
es.finishEvent(header);
es.setCh}
}
}
es.finishEvent(header);
es.setChecksumEnabl}
}
}
es.finishEvent(header);
es.setChecksumEnabled(context.getChecksumEnabled());
}
}
}
es.finishEvent(header);
es.setCh}
}
}
}
}
}
es.finishEvent(header);
es.setChecksumEnabled(context.getChecksumEnabled(}
}
}
}
}
}
}
}
}
es.finishEvent(h}
}
}
es.finishEvent(header);
es.setChecksumEnabled(context}
}
}
es.finishEvent(header);
es.s}
}
}
es.finishEvent(header);
}
}
}
es.finishEvent(header);
}
}
}
es.finishEvent(header);
}
}
}
es.finishEvent(header);
}
}
}
es.finishEvent(header)}
}
}
es.finishEvent(header);
es.set}
}
}
es.finishEvent(header);
es.setChecksumEna}
}
}
es.finishEvent(header);
es.}
}
}
es.finishEvent(header);
es.setChecksumEnabled(context.getChecksumEna}
}
}
}
}
}
}
es.finishEvent}
}
}
es.finishEvent(header);
es.setChecksumEnabled(context.getChe}
}
}
es.finishEvent(header);
es.setC}
}
}
}
}
}
es.finishEvent(header);
es.setChecksumEnabled(cont}
}
}
es.finishEvent(header);
es.setCh}
}
}
es.finishEvent(header);
}
}
}
}
}
}
}
es.finishEvent(heade}
}
}
es.finishEvent(h}
}
}
es.finishEvent(header);
es.setChecksumEnabled(context.getChecksumEnabled());
if ( isFormatDescription}
}
}
}
}
e}
}
}
es.finishE}
}
}
es.finish}
}
}
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
boolean isFormatDescriptionEvent = header.getEventType() == MySQLConstants.FORMAT_DESCRIPTION_EVENT;
header = es.getNextBinlogHeader();