|
@@ -70,6 +70,7 @@ import org.apache.hadoop.hdfs.web.WebHdfsFileSystem;
|
|
|
import org.apache.hadoop.hdfs.web.resources.AccessTimeParam;
|
|
|
import org.apache.hadoop.hdfs.web.resources.BlockSizeParam;
|
|
|
import org.apache.hadoop.hdfs.web.resources.BufferSizeParam;
|
|
|
+import org.apache.hadoop.hdfs.web.resources.ConcatSourcesParam;
|
|
|
import org.apache.hadoop.hdfs.web.resources.CreateParentParam;
|
|
|
import org.apache.hadoop.hdfs.web.resources.DelegationParam;
|
|
|
import org.apache.hadoop.hdfs.web.resources.DeleteOpParam;
|
|
@@ -483,10 +484,12 @@ public class NamenodeWebHdfsMethods {
|
|
|
final DoAsParam doAsUser,
|
|
|
@QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
|
|
|
final PostOpParam op,
|
|
|
+ @QueryParam(ConcatSourcesParam.NAME) @DefaultValue(ConcatSourcesParam.DEFAULT)
|
|
|
+ final ConcatSourcesParam concatSrcs,
|
|
|
@QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
|
|
|
final BufferSizeParam bufferSize
|
|
|
) throws IOException, InterruptedException {
|
|
|
- return post(ugi, delegation, username, doAsUser, ROOT, op, bufferSize);
|
|
|
+ return post(ugi, delegation, username, doAsUser, ROOT, op, concatSrcs, bufferSize);
|
|
|
}
|
|
|
|
|
|
/** Handle HTTP POST request. */
|
|
@@ -505,11 +508,13 @@ public class NamenodeWebHdfsMethods {
|
|
|
@PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
|
|
|
@QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
|
|
|
final PostOpParam op,
|
|
|
+ @QueryParam(ConcatSourcesParam.NAME) @DefaultValue(ConcatSourcesParam.DEFAULT)
|
|
|
+ final ConcatSourcesParam concatSrcs,
|
|
|
@QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
|
|
|
final BufferSizeParam bufferSize
|
|
|
) throws IOException, InterruptedException {
|
|
|
|
|
|
- init(ugi, delegation, username, doAsUser, path, op, bufferSize);
|
|
|
+ init(ugi, delegation, username, doAsUser, path, op, concatSrcs, bufferSize);
|
|
|
|
|
|
return ugi.doAs(new PrivilegedExceptionAction<Response>() {
|
|
|
@Override
|
|
@@ -517,7 +522,7 @@ public class NamenodeWebHdfsMethods {
|
|
|
REMOTE_ADDRESS.set(request.getRemoteAddr());
|
|
|
try {
|
|
|
return post(ugi, delegation, username, doAsUser,
|
|
|
- path.getAbsolutePath(), op, bufferSize);
|
|
|
+ path.getAbsolutePath(), op, concatSrcs, bufferSize);
|
|
|
} finally {
|
|
|
REMOTE_ADDRESS.set(null);
|
|
|
}
|
|
@@ -532,6 +537,7 @@ public class NamenodeWebHdfsMethods {
|
|
|
final DoAsParam doAsUser,
|
|
|
final String fullpath,
|
|
|
final PostOpParam op,
|
|
|
+ final ConcatSourcesParam concatSrcs,
|
|
|
final BufferSizeParam bufferSize
|
|
|
) throws IOException, URISyntaxException {
|
|
|
final NameNode namenode = (NameNode)context.getAttribute("name.node");
|
|
@@ -543,6 +549,11 @@ public class NamenodeWebHdfsMethods {
|
|
|
fullpath, op.getValue(), -1L, -1L, bufferSize);
|
|
|
return Response.temporaryRedirect(uri).type(MediaType.APPLICATION_OCTET_STREAM).build();
|
|
|
}
|
|
|
+ case CONCAT:
|
|
|
+ {
|
|
|
+ namenode.getRpcServer().concat(fullpath, concatSrcs.getAbsolutePaths());
|
|
|
+ return Response.ok().build();
|
|
|
+ }
|
|
|
default:
|
|
|
throw new UnsupportedOperationException(op + " is not supported");
|
|
|
}
|