mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed bio socket
This commit is contained in:
@@ -2,12 +2,12 @@ package com.alibaba.otter.canal.parse.driver.mysql.socket;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InterruptedIOException;
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
import java.net.SocketException;
|
import java.net.SocketException;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
|
import java.nio.channels.ClosedByInterruptException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用BIO进行dump
|
* 使用BIO进行dump
|
||||||
@@ -56,7 +56,7 @@ public class BioSocketChannel implements SocketChannel {
|
|||||||
}
|
}
|
||||||
} catch (SocketTimeoutException te) {
|
} catch (SocketTimeoutException te) {
|
||||||
if (Thread.interrupted()) {
|
if (Thread.interrupted()) {
|
||||||
throw new InterruptedIOException("Interrupted while reading.");
|
throw new ClosedByInterruptException("Interrupted while reading.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ public class BioSocketChannel implements SocketChannel {
|
|||||||
}
|
}
|
||||||
} catch (SocketTimeoutException te) {
|
} catch (SocketTimeoutException te) {
|
||||||
if (Thread.interrupted()) {
|
if (Thread.interrupted()) {
|
||||||
throw new InterruptedIOException("Interrupted while reading.");
|
throw new ClosedByInterruptException();
|
||||||
}
|
}
|
||||||
accTimeout += SO_TIMEOUT;
|
accTimeout += SO_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class AbstractCanalClientTest {
|
|||||||
context_format += "****************************************************" + SEP;
|
context_format += "****************************************************" + SEP;
|
||||||
|
|
||||||
row_format = SEP
|
row_format = SEP
|
||||||
+ "----------------> binlog[{}:{}] , name[{},{}] , eventType : {} , executeTime : {}({}) , delay : {}ms"
|
+ "----------------> binlog[{}:{}] , name[{},{}] , eventType : {} , executeTime : {}({}) , delay : {} ms"
|
||||||
+ SEP;
|
+ SEP;
|
||||||
|
|
||||||
transaction_format = SEP + "================> binlog[{}:{}] , executeTime : {}({}) , delay : {}ms" + SEP;
|
transaction_format = SEP + "================> binlog[{}:{}] , executeTime : {}({}) , delay : {}ms" + SEP;
|
||||||
|
|||||||
Reference in New Issue
Block a user