|
|
@ -5,16 +5,12 @@ import org.apache.http.HttpHeaders; |
|
|
|
import org.apache.http.HttpResponse; |
|
|
|
import org.apache.http.client.HttpClient; |
|
|
|
import org.apache.http.client.methods.HttpGet; |
|
|
|
import org.apache.http.impl.client.HttpClientBuilder; |
|
|
|
import org.apache.http.impl.client.DefaultHttpClient; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.OutputStream; |
|
|
|
import java.nio.ByteBuffer; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
public class SeaweedRead { |
|
|
|
|
|
|
@ -59,7 +55,7 @@ public class SeaweedRead { |
|
|
|
} |
|
|
|
|
|
|
|
private static int readChunkView(long position, byte[] buffer, int startOffset, ChunkView chunkView, FilerProto.Locations locations) { |
|
|
|
HttpClient client = HttpClientBuilder.create().build(); |
|
|
|
HttpClient client = new DefaultHttpClient(); |
|
|
|
HttpGet request = new HttpGet( |
|
|
|
String.format("http://%s/%s", locations.getLocations(0).getUrl(), chunkView.fileId)); |
|
|
|
|
|
|
|