Java 类org.apache.hadoop.hdfs.protocol.CorruptFileBlocks 实例源码
项目:hadoop
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:aliyun-oss-hadoop-fs
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:big-c
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:hadoop-2.6.0-cdh5.4.3
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:hadoop-EAR
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:hadoop-EAR
文件:DFSClient.java
/** Version based list corrupt file blocks */
private CorruptFileBlocks versionBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (namenodeVersion < ClientProtocol.LIST_CORRUPT_FILEBLOCKS_VERSION) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older version of getCorruptFiles.");
if (cookie != null ) {
return new CorruptFileBlocks(new String[0], "");
}
ArrayList<String> str = new ArrayList<String>();
for (FileStatus stat : namenode.getCorruptFiles()) {
String filename = stat.getPath().toUri().getPath();
if (filename.startsWith(path)) {
str.add(filename);
}
}
return new CorruptFileBlocks(str.toArray(new String[str.size()]), "");
}
return namenode.listCorruptFileBlocks(path, cookie);
}
项目:hadoop-EAR
文件:DFSClient.java
/** Method based listCorruptFileBlocks */
private CorruptFileBlocks methodBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (!namenodeProtocolProxy.isMethodSupported("listCorruptFileBlocks",
String.class, String.class)) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older version of getCorruptFiles.");
if (cookie != null ) {
return new CorruptFileBlocks(new String[0], "");
}
ArrayList<String> str = new ArrayList<String>();
for (FileStatus stat : namenode.getCorruptFiles()) {
String filename = stat.getPath().toUri().getPath();
if (filename.startsWith(path)) {
str.add(filename);
}
}
return new CorruptFileBlocks(str.toArray(new String[str.size()]), "");
}
return namenode.listCorruptFileBlocks(path, cookie);
}
项目:hadoop-plus
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:FlexMap
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:hops
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:hadoop-TCP
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:hardfs
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:hadoop-on-lustre2
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:RDFS
文件:CorruptFileBlockIterator.java
private void loadNext() throws IOException {
if (files == null || fileIdx >= files.length) {
CorruptFileBlocks cfb = dfs.listCorruptFileBlocks(path, cookie);
files = cfb.getFiles();
cookie = cfb.getCookie();
fileIdx = 0;
callsMade++;
}
if (fileIdx >= files.length) {
// received an empty response
// there are no more corrupt file blocks
nextPath = null;
} else {
nextPath = string2Path(files[fileIdx]);
fileIdx++;
}
}
项目:RDFS
文件:DFSClient.java
/** Version based list corrupt file blocks */
private CorruptFileBlocks versionBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (namenodeVersion < ClientProtocol.LIST_CORRUPT_FILEBLOCKS_VERSION) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older version of getCorruptFiles.");
if (cookie != null ) {
return new CorruptFileBlocks(new String[0], "");
}
ArrayList<String> str = new ArrayList<String>();
for (FileStatus stat : namenode.getCorruptFiles()) {
String filename = stat.getPath().toUri().getPath();
if (filename.startsWith(path)) {
str.add(filename);
}
}
return new CorruptFileBlocks(str.toArray(new String[str.size()]), "");
}
return namenode.listCorruptFileBlocks(path, cookie);
}
项目:RDFS
文件:DFSClient.java
/** Method based listCorruptFileBlocks */
private CorruptFileBlocks methodBasedListCorruptFileBlocks(String path,
String cookie) throws IOException {
if (!namenodeProtocolProxy.isMethodSupported("listCorruptFileBlocks",
String.class, String.class)) {
LOG.info("NameNode version is " + namenodeVersion +
" Using older version of getCorruptFiles.");
if (cookie != null ) {
return new CorruptFileBlocks(new String[0], "");
}
ArrayList<String> str = new ArrayList<String>();
for (FileStatus stat : namenode.getCorruptFiles()) {
String filename = stat.getPath().toUri().getPath();
if (filename.startsWith(path)) {
str.add(filename);
}
}
return new CorruptFileBlocks(str.toArray(new String[str.size()]), "");
}
return namenode.listCorruptFileBlocks(path, cookie);
}
项目:hadoop
文件:DFSClient.java
/**
* @return a list in which each entry describes a corrupt file/block
* @throws IOException
*/
public CorruptFileBlocks listCorruptFileBlocks(String path,
String cookie)
throws IOException {
checkOpen();
TraceScope scope = getPathTraceScope("listCorruptFileBlocks", path);
try {
return namenode.listCorruptFileBlocks(path, cookie);
} finally {
scope.close();
}
}
项目:hadoop
文件:NameNodeRpcServer.java
@Override // ClientProtocol
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
checkNNStartup();
String[] cookieTab = new String[] { cookie };
Collection<FSNamesystem.CorruptFileBlockInfo> fbs =
namesystem.listCorruptFileBlocks(path, cookieTab);
String[] files = new String[fbs.size()];
int i = 0;
for(FSNamesystem.CorruptFileBlockInfo fb: fbs) {
files[i++] = fb.path;
}
return new CorruptFileBlocks(files, cookieTab[0]);
}
项目:hadoop
文件:PBHelper.java
public static CorruptFileBlocks convert(CorruptFileBlocksProto c) {
if (c == null)
return null;
List<String> fileList = c.getFilesList();
return new CorruptFileBlocks(fileList.toArray(new String[fileList.size()]),
c.getCookie());
}
项目:hadoop
文件:PBHelper.java
public static CorruptFileBlocksProto convert(CorruptFileBlocks c) {
if (c == null)
return null;
return CorruptFileBlocksProto.newBuilder().
addAllFiles(Arrays.asList(c.getFiles())).
setCookie(c.getCookie()).
build();
}
项目:hadoop
文件:ClientNamenodeProtocolServerSideTranslatorPB.java
@Override
public ListCorruptFileBlocksResponseProto listCorruptFileBlocks(
RpcController controller, ListCorruptFileBlocksRequestProto req)
throws ServiceException {
try {
CorruptFileBlocks result = server.listCorruptFileBlocks(
req.getPath(), req.hasCookie() ? req.getCookie(): null);
return ListCorruptFileBlocksResponseProto.newBuilder()
.setCorrupt(PBHelper.convert(result))
.build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
项目:hadoop
文件:ClientNamenodeProtocolTranslatorPB.java
@Override
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
ListCorruptFileBlocksRequestProto.Builder req =
ListCorruptFileBlocksRequestProto.newBuilder().setPath(path);
if (cookie != null)
req.setCookie(cookie);
try {
return PBHelper.convert(
rpcProxy.listCorruptFileBlocks(null, req.build()).getCorrupt());
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
项目:aliyun-oss-hadoop-fs
文件:DFSClient.java
/**
* @return a list in which each entry describes a corrupt file/block
* @throws IOException
*/
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
checkOpen();
try (TraceScope ignored
= newPathTraceScope("listCorruptFileBlocks", path)) {
return namenode.listCorruptFileBlocks(path, cookie);
}
}
项目:aliyun-oss-hadoop-fs
文件:PBHelperClient.java
public static CorruptFileBlocks convert(CorruptFileBlocksProto c) {
if (c == null)
return null;
List<String> fileList = c.getFilesList();
return new CorruptFileBlocks(fileList.toArray(new String[fileList.size()]),
c.getCookie());
}
项目:aliyun-oss-hadoop-fs
文件:PBHelperClient.java
public static CorruptFileBlocksProto convert(CorruptFileBlocks c) {
if (c == null)
return null;
return CorruptFileBlocksProto.newBuilder().
addAllFiles(Arrays.asList(c.getFiles())).
setCookie(c.getCookie()).
build();
}
项目:aliyun-oss-hadoop-fs
文件:ClientNamenodeProtocolTranslatorPB.java
@Override
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
ListCorruptFileBlocksRequestProto.Builder req =
ListCorruptFileBlocksRequestProto.newBuilder().setPath(path);
if (cookie != null)
req.setCookie(cookie);
try {
return PBHelperClient.convert(
rpcProxy.listCorruptFileBlocks(null, req.build()).getCorrupt());
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
项目:aliyun-oss-hadoop-fs
文件:NameNodeRpcServer.java
@Override // ClientProtocol
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
checkNNStartup();
String[] cookieTab = new String[] { cookie };
Collection<FSNamesystem.CorruptFileBlockInfo> fbs =
namesystem.listCorruptFileBlocks(path, cookieTab);
String[] files = new String[fbs.size()];
int i = 0;
for(FSNamesystem.CorruptFileBlockInfo fb: fbs) {
files[i++] = fb.path;
}
return new CorruptFileBlocks(files, cookieTab[0]);
}
项目:aliyun-oss-hadoop-fs
文件:ClientNamenodeProtocolServerSideTranslatorPB.java
@Override
public ListCorruptFileBlocksResponseProto listCorruptFileBlocks(
RpcController controller, ListCorruptFileBlocksRequestProto req)
throws ServiceException {
try {
CorruptFileBlocks result = server.listCorruptFileBlocks(
req.getPath(), req.hasCookie() ? req.getCookie(): null);
return ListCorruptFileBlocksResponseProto.newBuilder()
.setCorrupt(PBHelperClient.convert(result))
.build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
项目:big-c
文件:DFSClient.java
/**
* @return a list in which each entry describes a corrupt file/block
* @throws IOException
*/
public CorruptFileBlocks listCorruptFileBlocks(String path,
String cookie)
throws IOException {
checkOpen();
TraceScope scope = getPathTraceScope("listCorruptFileBlocks", path);
try {
return namenode.listCorruptFileBlocks(path, cookie);
} finally {
scope.close();
}
}
项目:big-c
文件:NameNodeRpcServer.java
@Override // ClientProtocol
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
checkNNStartup();
String[] cookieTab = new String[] { cookie };
Collection<FSNamesystem.CorruptFileBlockInfo> fbs =
namesystem.listCorruptFileBlocks(path, cookieTab);
String[] files = new String[fbs.size()];
int i = 0;
for(FSNamesystem.CorruptFileBlockInfo fb: fbs) {
files[i++] = fb.path;
}
return new CorruptFileBlocks(files, cookieTab[0]);
}
项目:big-c
文件:PBHelper.java
public static CorruptFileBlocks convert(CorruptFileBlocksProto c) {
if (c == null)
return null;
List<String> fileList = c.getFilesList();
return new CorruptFileBlocks(fileList.toArray(new String[fileList.size()]),
c.getCookie());
}
项目:big-c
文件:PBHelper.java
public static CorruptFileBlocksProto convert(CorruptFileBlocks c) {
if (c == null)
return null;
return CorruptFileBlocksProto.newBuilder().
addAllFiles(Arrays.asList(c.getFiles())).
setCookie(c.getCookie()).
build();
}
项目:big-c
文件:ClientNamenodeProtocolServerSideTranslatorPB.java
@Override
public ListCorruptFileBlocksResponseProto listCorruptFileBlocks(
RpcController controller, ListCorruptFileBlocksRequestProto req)
throws ServiceException {
try {
CorruptFileBlocks result = server.listCorruptFileBlocks(
req.getPath(), req.hasCookie() ? req.getCookie(): null);
return ListCorruptFileBlocksResponseProto.newBuilder()
.setCorrupt(PBHelper.convert(result))
.build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
项目:big-c
文件:ClientNamenodeProtocolTranslatorPB.java
@Override
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
ListCorruptFileBlocksRequestProto.Builder req =
ListCorruptFileBlocksRequestProto.newBuilder().setPath(path);
if (cookie != null)
req.setCookie(cookie);
try {
return PBHelper.convert(
rpcProxy.listCorruptFileBlocks(null, req.build()).getCorrupt());
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}
项目:hadoop-2.6.0-cdh5.4.3
文件:NameNodeRpcServer.java
@Override // ClientProtocol
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
checkNNStartup();
String[] cookieTab = new String[] { cookie };
Collection<FSNamesystem.CorruptFileBlockInfo> fbs =
namesystem.listCorruptFileBlocks(path, cookieTab);
String[] files = new String[fbs.size()];
int i = 0;
for(FSNamesystem.CorruptFileBlockInfo fb: fbs) {
files[i++] = fb.path;
}
return new CorruptFileBlocks(files, cookieTab[0]);
}
项目:hadoop-2.6.0-cdh5.4.3
文件:AuthorizationProviderProxyClientProtocol.java
@Override
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
try {
AuthorizationProvider.beginClientOp();
return server.listCorruptFileBlocks(path, cookie);
} finally {
AuthorizationProvider.endClientOp();
}
}
项目:hadoop-2.6.0-cdh5.4.3
文件:PBHelper.java
public static CorruptFileBlocks convert(CorruptFileBlocksProto c) {
if (c == null)
return null;
List<String> fileList = c.getFilesList();
return new CorruptFileBlocks(fileList.toArray(new String[fileList.size()]),
c.getCookie());
}
项目:hadoop-2.6.0-cdh5.4.3
文件:PBHelper.java
public static CorruptFileBlocksProto convert(CorruptFileBlocks c) {
if (c == null)
return null;
return CorruptFileBlocksProto.newBuilder().
addAllFiles(Arrays.asList(c.getFiles())).
setCookie(c.getCookie()).
build();
}
项目:hadoop-2.6.0-cdh5.4.3
文件:ClientNamenodeProtocolServerSideTranslatorPB.java
@Override
public ListCorruptFileBlocksResponseProto listCorruptFileBlocks(
RpcController controller, ListCorruptFileBlocksRequestProto req)
throws ServiceException {
try {
CorruptFileBlocks result = server.listCorruptFileBlocks(
req.getPath(), req.hasCookie() ? req.getCookie(): null);
return ListCorruptFileBlocksResponseProto.newBuilder()
.setCorrupt(PBHelper.convert(result))
.build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
项目:hadoop-2.6.0-cdh5.4.3
文件:ClientNamenodeProtocolTranslatorPB.java
@Override
public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
throws IOException {
ListCorruptFileBlocksRequestProto.Builder req =
ListCorruptFileBlocksRequestProto.newBuilder().setPath(path);
if (cookie != null)
req.setCookie(cookie);
try {
return PBHelper.convert(
rpcProxy.listCorruptFileBlocks(null, req.build()).getCorrupt());
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
}