mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Java client: ByteBuffer.clear supports higher JDK versions
fix https://github.com/chrislusf/seaweedfs/issues/1836
This commit is contained in:
parent
d3a7196635
commit
1d848641d7
|
@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InterruptedIOException;
|
import java.io.InterruptedIOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.nio.Buffer;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
|
@ -217,7 +218,7 @@ public class SeaweedOutputStream extends OutputStream {
|
||||||
|
|
||||||
private synchronized int submitWriteBufferToService(final ByteBuffer bufferToWrite, final long writePosition) throws IOException {
|
private synchronized int submitWriteBufferToService(final ByteBuffer bufferToWrite, final long writePosition) throws IOException {
|
||||||
|
|
||||||
bufferToWrite.flip();
|
((Buffer)bufferToWrite).flip();
|
||||||
int bytesLength = bufferToWrite.limit() - bufferToWrite.position();
|
int bytesLength = bufferToWrite.limit() - bufferToWrite.position();
|
||||||
|
|
||||||
if (threadExecutor.getQueue().size() >= maxConcurrentRequestCount) {
|
if (threadExecutor.getQueue().size() >= maxConcurrentRequestCount) {
|
||||||
|
|
Loading…
Reference in a new issue