diff --git a/core/client/src/main/java/alluxio/client/file/FileSystemMasterClient.java b/core/client/src/main/java/alluxio/client/file/FileSystemMasterClient.java index 6c590ba818f7..3a5ea982905e 100644 --- a/core/client/src/main/java/alluxio/client/file/FileSystemMasterClient.java +++ b/core/client/src/main/java/alluxio/client/file/FileSystemMasterClient.java @@ -238,7 +238,7 @@ public synchronized void loadMetadata(final AlluxioURI path, retryRPC(new RpcCallableThrowsAlluxioTException() { @Override public Long call() throws AlluxioTException, TException { - return mClient.loadMetadata(path.toString(), options.isRecursive()); + return mClient.loadMetadata(path.toString(), options.toThrift()); } }); } diff --git a/core/client/src/main/java/alluxio/client/file/options/LoadMetadataOptions.java b/core/client/src/main/java/alluxio/client/file/options/LoadMetadataOptions.java index d9af9120469c..7cf18e500d7b 100644 --- a/core/client/src/main/java/alluxio/client/file/options/LoadMetadataOptions.java +++ b/core/client/src/main/java/alluxio/client/file/options/LoadMetadataOptions.java @@ -12,6 +12,7 @@ package alluxio.client.file.options; import alluxio.annotation.PublicApi; +import alluxio.thrift.LoadMetadataTOptions; import com.google.common.base.Objects; @@ -24,6 +25,7 @@ @NotThreadSafe public final class LoadMetadataOptions { private boolean mRecursive; + private boolean mLoadDirectChildren; /** * @return the default {@link LoadMetadataOptions} @@ -34,6 +36,7 @@ public static LoadMetadataOptions defaults() { private LoadMetadataOptions() { mRecursive = false; + mLoadDirectChildren = false; } /** @@ -44,6 +47,14 @@ public boolean isRecursive() { return mRecursive; } + /** + * @return the load direct children flag. It specifies whether the direct children should + * be loaded. + */ + public boolean isLoadDirectChildren() { + return mLoadDirectChildren; + } + /** * Sets the recursive flag. * @@ -56,6 +67,18 @@ public LoadMetadataOptions setRecursive(boolean recursive) { return this; } + /** + * Sets the load direct children flag. + * + * @param loadDirectChildren the load direct children flag. It specifies whether the direct + * children should be loaded. + * @return the updated object + */ + public LoadMetadataOptions setLoadDirectChildren(boolean loadDirectChildren) { + mLoadDirectChildren = loadDirectChildren; + return this; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -65,18 +88,28 @@ public boolean equals(Object o) { return false; } LoadMetadataOptions that = (LoadMetadataOptions) o; - return Objects.equal(mRecursive, that.mRecursive); + return Objects.equal(mRecursive, that.mRecursive) + && Objects.equal(mLoadDirectChildren, that.mLoadDirectChildren); } @Override public int hashCode() { - return Objects.hashCode(mRecursive); + return Objects.hashCode(mRecursive, mLoadDirectChildren); } @Override public String toString() { - return Objects.toStringHelper(this) - .add("recursive", mRecursive) - .toString(); + return Objects.toStringHelper(this).add("recursive", mRecursive) + .add("loadDirectChildren", mLoadDirectChildren).toString(); + } + + /** + * @return the thrift representation of the options + */ + public LoadMetadataTOptions toThrift() { + LoadMetadataTOptions options = new LoadMetadataTOptions(); + options.setRecursive(mRecursive); + options.setLoadDirectChildren(mLoadDirectChildren); + return options; } } diff --git a/core/common/src/main/java/alluxio/thrift/AlluxioService.java b/core/common/src/main/java/alluxio/thrift/AlluxioService.java index f70270c47934..52de74953afe 100644 --- a/core/common/src/main/java/alluxio/thrift/AlluxioService.java +++ b/core/common/src/main/java/alluxio/thrift/AlluxioService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class AlluxioService { public interface Iface { diff --git a/core/common/src/main/java/alluxio/thrift/AlluxioTException.java b/core/common/src/main/java/alluxio/thrift/AlluxioTException.java index 10666749f0ed..982d2bbff8d5 100644 --- a/core/common/src/main/java/alluxio/thrift/AlluxioTException.java +++ b/core/common/src/main/java/alluxio/thrift/AlluxioTException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class AlluxioTException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlluxioTException"); diff --git a/core/common/src/main/java/alluxio/thrift/BlockInfo.java b/core/common/src/main/java/alluxio/thrift/BlockInfo.java index 358dbcf20ad5..ee0b06e1149b 100644 --- a/core/common/src/main/java/alluxio/thrift/BlockInfo.java +++ b/core/common/src/main/java/alluxio/thrift/BlockInfo.java @@ -38,7 +38,7 @@ * Contains the information of a block in Alluxio. It maintains the worker nodes where the replicas * of the blocks are stored. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class BlockInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BlockInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/BlockLocation.java b/core/common/src/main/java/alluxio/thrift/BlockLocation.java index e66b24fc8992..82887d054aa5 100644 --- a/core/common/src/main/java/alluxio/thrift/BlockLocation.java +++ b/core/common/src/main/java/alluxio/thrift/BlockLocation.java @@ -37,7 +37,7 @@ /** * Information about blocks. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class BlockLocation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BlockLocation"); diff --git a/core/common/src/main/java/alluxio/thrift/BlockMasterClientService.java b/core/common/src/main/java/alluxio/thrift/BlockMasterClientService.java index ba71c5508460..38efe186cffb 100644 --- a/core/common/src/main/java/alluxio/thrift/BlockMasterClientService.java +++ b/core/common/src/main/java/alluxio/thrift/BlockMasterClientService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class BlockMasterClientService { /** diff --git a/core/common/src/main/java/alluxio/thrift/BlockMasterWorkerService.java b/core/common/src/main/java/alluxio/thrift/BlockMasterWorkerService.java index e406e9f9822e..48569cd6f572 100644 --- a/core/common/src/main/java/alluxio/thrift/BlockMasterWorkerService.java +++ b/core/common/src/main/java/alluxio/thrift/BlockMasterWorkerService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class BlockMasterWorkerService { /** diff --git a/core/common/src/main/java/alluxio/thrift/BlockWorkerClientService.java b/core/common/src/main/java/alluxio/thrift/BlockWorkerClientService.java index 488c7706427a..9481f34a88a1 100644 --- a/core/common/src/main/java/alluxio/thrift/BlockWorkerClientService.java +++ b/core/common/src/main/java/alluxio/thrift/BlockWorkerClientService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class BlockWorkerClientService { public interface Iface extends alluxio.thrift.AlluxioService.Iface { diff --git a/core/common/src/main/java/alluxio/thrift/Command.java b/core/common/src/main/java/alluxio/thrift/Command.java index 18d8d4f416ee..941b396cce49 100644 --- a/core/common/src/main/java/alluxio/thrift/Command.java +++ b/core/common/src/main/java/alluxio/thrift/Command.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class Command implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Command"); diff --git a/core/common/src/main/java/alluxio/thrift/CommandLineJobInfo.java b/core/common/src/main/java/alluxio/thrift/CommandLineJobInfo.java index bcd636d111a4..290207f47377 100644 --- a/core/common/src/main/java/alluxio/thrift/CommandLineJobInfo.java +++ b/core/common/src/main/java/alluxio/thrift/CommandLineJobInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class CommandLineJobInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommandLineJobInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/CompleteFileTOptions.java b/core/common/src/main/java/alluxio/thrift/CompleteFileTOptions.java index 3d5253be27fe..6eb1badfdf82 100644 --- a/core/common/src/main/java/alluxio/thrift/CompleteFileTOptions.java +++ b/core/common/src/main/java/alluxio/thrift/CompleteFileTOptions.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class CompleteFileTOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CompleteFileTOptions"); diff --git a/core/common/src/main/java/alluxio/thrift/CreateDirectoryTOptions.java b/core/common/src/main/java/alluxio/thrift/CreateDirectoryTOptions.java index 02a1263ab306..bd95b1d3c0f0 100644 --- a/core/common/src/main/java/alluxio/thrift/CreateDirectoryTOptions.java +++ b/core/common/src/main/java/alluxio/thrift/CreateDirectoryTOptions.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class CreateDirectoryTOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreateDirectoryTOptions"); diff --git a/core/common/src/main/java/alluxio/thrift/CreateFileTOptions.java b/core/common/src/main/java/alluxio/thrift/CreateFileTOptions.java index 694add184055..4f6c5ab6412a 100644 --- a/core/common/src/main/java/alluxio/thrift/CreateFileTOptions.java +++ b/core/common/src/main/java/alluxio/thrift/CreateFileTOptions.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class CreateFileTOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreateFileTOptions"); diff --git a/core/common/src/main/java/alluxio/thrift/DependencyInfo.java b/core/common/src/main/java/alluxio/thrift/DependencyInfo.java index 2bad1e6ce361..c1dc76bbbee3 100644 --- a/core/common/src/main/java/alluxio/thrift/DependencyInfo.java +++ b/core/common/src/main/java/alluxio/thrift/DependencyInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class DependencyInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DependencyInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/FileBlockInfo.java b/core/common/src/main/java/alluxio/thrift/FileBlockInfo.java index a8f148826d15..cfd3ba99e655 100644 --- a/core/common/src/main/java/alluxio/thrift/FileBlockInfo.java +++ b/core/common/src/main/java/alluxio/thrift/FileBlockInfo.java @@ -38,7 +38,7 @@ * Contains the information of a block in a file. In addition to the BlockInfo, it includes the * offset in the file, and the under file system locations of the block replicas. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class FileBlockInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileBlockInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/FileInfo.java b/core/common/src/main/java/alluxio/thrift/FileInfo.java index 407fbf8a17a7..bbbfde13049f 100644 --- a/core/common/src/main/java/alluxio/thrift/FileInfo.java +++ b/core/common/src/main/java/alluxio/thrift/FileInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class FileInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/FileSystemCommand.java b/core/common/src/main/java/alluxio/thrift/FileSystemCommand.java index dc772b7cf876..97e9c69505aa 100644 --- a/core/common/src/main/java/alluxio/thrift/FileSystemCommand.java +++ b/core/common/src/main/java/alluxio/thrift/FileSystemCommand.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class FileSystemCommand implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileSystemCommand"); diff --git a/core/common/src/main/java/alluxio/thrift/FileSystemMasterClientService.java b/core/common/src/main/java/alluxio/thrift/FileSystemMasterClientService.java index 6602846198af..ff8ca4291958 100644 --- a/core/common/src/main/java/alluxio/thrift/FileSystemMasterClientService.java +++ b/core/common/src/main/java/alluxio/thrift/FileSystemMasterClientService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class FileSystemMasterClientService { /** @@ -131,9 +131,9 @@ public interface Iface extends alluxio.thrift.AlluxioService.Iface { * * @param ufsPath the path of the under file system * - * @param recursive whether to load meta data recursively + * @param options whether to load meta data recursively */ - public long loadMetadata(String ufsPath, boolean recursive) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; + public long loadMetadata(String ufsPath, LoadMetadataTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException; /** * Creates a new "mount point", mounts the given UFS path in the Alluxio namespace at the given @@ -215,7 +215,7 @@ public interface AsyncIface extends alluxio.thrift.AlluxioService .AsyncIface { public void listStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void loadMetadata(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void loadMetadata(String ufsPath, LoadMetadataTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void mount(String alluxioPath, String ufsPath, MountTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -505,17 +505,17 @@ public List recv_listStatus() throws alluxio.thrift.AlluxioTException, throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "listStatus failed: unknown result"); } - public long loadMetadata(String ufsPath, boolean recursive) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException + public long loadMetadata(String ufsPath, LoadMetadataTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException { - send_loadMetadata(ufsPath, recursive); + send_loadMetadata(ufsPath, options); return recv_loadMetadata(); } - public void send_loadMetadata(String ufsPath, boolean recursive) throws org.apache.thrift.TException + public void send_loadMetadata(String ufsPath, LoadMetadataTOptions options) throws org.apache.thrift.TException { loadMetadata_args args = new loadMetadata_args(); args.setUfsPath(ufsPath); - args.setRecursive(recursive); + args.setOptions(options); sendBase("loadMetadata", args); } @@ -1034,27 +1034,27 @@ public List getResult() throws alluxio.thrift.AlluxioTException, org.a } } - public void loadMetadata(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void loadMetadata(String ufsPath, LoadMetadataTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - loadMetadata_call method_call = new loadMetadata_call(ufsPath, recursive, resultHandler, this, ___protocolFactory, ___transport); + loadMetadata_call method_call = new loadMetadata_call(ufsPath, options, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class loadMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { private String ufsPath; - private boolean recursive; - public loadMetadata_call(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + private LoadMetadataTOptions options; + public loadMetadata_call(String ufsPath, LoadMetadataTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.ufsPath = ufsPath; - this.recursive = recursive; + this.options = options; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("loadMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); loadMetadata_args args = new loadMetadata_args(); args.setUfsPath(ufsPath); - args.setRecursive(recursive); + args.setOptions(options); args.write(prot); prot.writeMessageEnd(); } @@ -1566,7 +1566,7 @@ protected boolean isOneway() { public loadMetadata_result getResult(I iface, loadMetadata_args args) throws org.apache.thrift.TException { loadMetadata_result result = new loadMetadata_result(); try { - result.success = iface.loadMetadata(args.ufsPath, args.recursive); + result.success = iface.loadMetadata(args.ufsPath, args.options); result.setSuccessIsSet(true); } catch (alluxio.thrift.AlluxioTException e) { result.e = e; @@ -2390,7 +2390,7 @@ protected boolean isOneway() { } public void start(I iface, loadMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.loadMetadata(args.ufsPath, args.recursive,resultHandler); + iface.loadMetadata(args.ufsPath, args.options,resultHandler); } } @@ -11281,7 +11281,7 @@ public static class loadMetadata_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -11290,7 +11290,7 @@ public static class loadMetadata_args implements org.apache.thrift.TBase byName = new HashMap(); @@ -11318,8 +11318,8 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // UFS_PATH return UFS_PATH; - case 2: // RECURSIVE - return RECURSIVE; + case 2: // OPTIONS + return OPTIONS; default: return null; } @@ -11360,15 +11360,13 @@ public String getFieldName() { } // isset id assignments - private static final int __RECURSIVE_ISSET_ID = 0; - private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.UFS_PATH, new org.apache.thrift.meta_data.FieldMetaData("ufsPath", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.RECURSIVE, new org.apache.thrift.meta_data.FieldMetaData("recursive", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LoadMetadataTOptions.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(loadMetadata_args.class, metaDataMap); } @@ -11378,23 +11376,23 @@ public loadMetadata_args() { public loadMetadata_args( String ufsPath, - boolean recursive) + LoadMetadataTOptions options) { this(); this.ufsPath = ufsPath; - this.recursive = recursive; - setRecursiveIsSet(true); + this.options = options; } /** * Performs a deep copy on other. */ public loadMetadata_args(loadMetadata_args other) { - __isset_bitfield = other.__isset_bitfield; if (other.isSetUfsPath()) { this.ufsPath = other.ufsPath; } - this.recursive = other.recursive; + if (other.isSetOptions()) { + this.options = new LoadMetadataTOptions(other.options); + } } public loadMetadata_args deepCopy() { @@ -11404,8 +11402,7 @@ public loadMetadata_args deepCopy() { @Override public void clear() { this.ufsPath = null; - setRecursiveIsSet(false); - this.recursive = false; + this.options = null; } /** @@ -11441,30 +11438,31 @@ public void setUfsPathIsSet(boolean value) { /** * whether to load meta data recursively */ - public boolean isRecursive() { - return this.recursive; + public LoadMetadataTOptions getOptions() { + return this.options; } /** * whether to load meta data recursively */ - public loadMetadata_args setRecursive(boolean recursive) { - this.recursive = recursive; - setRecursiveIsSet(true); + public loadMetadata_args setOptions(LoadMetadataTOptions options) { + this.options = options; return this; } - public void unsetRecursive() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); + public void unsetOptions() { + this.options = null; } - /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ - public boolean isSetRecursive() { - return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); + /** Returns true if field options is set (has been assigned a value) and false otherwise */ + public boolean isSetOptions() { + return this.options != null; } - public void setRecursiveIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); + public void setOptionsIsSet(boolean value) { + if (!value) { + this.options = null; + } } public void setFieldValue(_Fields field, Object value) { @@ -11477,11 +11475,11 @@ public void setFieldValue(_Fields field, Object value) { } break; - case RECURSIVE: + case OPTIONS: if (value == null) { - unsetRecursive(); + unsetOptions(); } else { - setRecursive((Boolean)value); + setOptions((LoadMetadataTOptions)value); } break; @@ -11493,8 +11491,8 @@ public Object getFieldValue(_Fields field) { case UFS_PATH: return getUfsPath(); - case RECURSIVE: - return isRecursive(); + case OPTIONS: + return getOptions(); } throw new IllegalStateException(); @@ -11509,8 +11507,8 @@ public boolean isSet(_Fields field) { switch (field) { case UFS_PATH: return isSetUfsPath(); - case RECURSIVE: - return isSetRecursive(); + case OPTIONS: + return isSetOptions(); } throw new IllegalStateException(); } @@ -11537,12 +11535,12 @@ public boolean equals(loadMetadata_args that) { return false; } - boolean this_present_recursive = true; - boolean that_present_recursive = true; - if (this_present_recursive || that_present_recursive) { - if (!(this_present_recursive && that_present_recursive)) + boolean this_present_options = true && this.isSetOptions(); + boolean that_present_options = true && that.isSetOptions(); + if (this_present_options || that_present_options) { + if (!(this_present_options && that_present_options)) return false; - if (this.recursive != that.recursive) + if (!this.options.equals(that.options)) return false; } @@ -11558,10 +11556,10 @@ public int hashCode() { if (present_ufsPath) list.add(ufsPath); - boolean present_recursive = true; - list.add(present_recursive); - if (present_recursive) - list.add(recursive); + boolean present_options = true && (isSetOptions()); + list.add(present_options); + if (present_options) + list.add(options); return list.hashCode(); } @@ -11584,12 +11582,12 @@ public int compareTo(loadMetadata_args other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetRecursive()).compareTo(other.isSetRecursive()); + lastComparison = Boolean.valueOf(isSetOptions()).compareTo(other.isSetOptions()); if (lastComparison != 0) { return lastComparison; } - if (isSetRecursive()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recursive, other.recursive); + if (isSetOptions()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, other.options); if (lastComparison != 0) { return lastComparison; } @@ -11622,8 +11620,12 @@ public String toString() { } first = false; if (!first) sb.append(", "); - sb.append("recursive:"); - sb.append(this.recursive); + sb.append("options:"); + if (this.options == null) { + sb.append("null"); + } else { + sb.append(this.options); + } first = false; sb.append(")"); return sb.toString(); @@ -11632,6 +11634,9 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity + if (options != null) { + options.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -11644,8 +11649,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -11678,10 +11681,11 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, loadMetadata_args s org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // RECURSIVE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.recursive = iprot.readBool(); - struct.setRecursiveIsSet(true); + case 2: // OPTIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.options = new LoadMetadataTOptions(); + struct.options.read(iprot); + struct.setOptionsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -11706,9 +11710,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, loadMetadata_args oprot.writeString(struct.ufsPath); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); - oprot.writeBool(struct.recursive); - oprot.writeFieldEnd(); + if (struct.options != null) { + oprot.writeFieldBegin(OPTIONS_FIELD_DESC); + struct.options.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -11730,15 +11736,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, loadMetadata_args s if (struct.isSetUfsPath()) { optionals.set(0); } - if (struct.isSetRecursive()) { + if (struct.isSetOptions()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetUfsPath()) { oprot.writeString(struct.ufsPath); } - if (struct.isSetRecursive()) { - oprot.writeBool(struct.recursive); + if (struct.isSetOptions()) { + struct.options.write(oprot); } } @@ -11751,8 +11757,9 @@ public void read(org.apache.thrift.protocol.TProtocol prot, loadMetadata_args st struct.setUfsPathIsSet(true); } if (incoming.get(1)) { - struct.recursive = iprot.readBool(); - struct.setRecursiveIsSet(true); + struct.options = new LoadMetadataTOptions(); + struct.options.read(iprot); + struct.setOptionsIsSet(true); } } } diff --git a/core/common/src/main/java/alluxio/thrift/FileSystemMasterWorkerService.java b/core/common/src/main/java/alluxio/thrift/FileSystemMasterWorkerService.java index bd32ad66e825..9ac24af0292c 100644 --- a/core/common/src/main/java/alluxio/thrift/FileSystemMasterWorkerService.java +++ b/core/common/src/main/java/alluxio/thrift/FileSystemMasterWorkerService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class FileSystemMasterWorkerService { /** diff --git a/core/common/src/main/java/alluxio/thrift/JobConfInfo.java b/core/common/src/main/java/alluxio/thrift/JobConfInfo.java index b93690c28e17..0a4f6d03d544 100644 --- a/core/common/src/main/java/alluxio/thrift/JobConfInfo.java +++ b/core/common/src/main/java/alluxio/thrift/JobConfInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class JobConfInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobConfInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/LineageInfo.java b/core/common/src/main/java/alluxio/thrift/LineageInfo.java index 6f4263eb464e..4cb26571b8ba 100644 --- a/core/common/src/main/java/alluxio/thrift/LineageInfo.java +++ b/core/common/src/main/java/alluxio/thrift/LineageInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class LineageInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LineageInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/LineageMasterClientService.java b/core/common/src/main/java/alluxio/thrift/LineageMasterClientService.java index 16b44f4614b2..ffd53a877672 100644 --- a/core/common/src/main/java/alluxio/thrift/LineageMasterClientService.java +++ b/core/common/src/main/java/alluxio/thrift/LineageMasterClientService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class LineageMasterClientService { /** diff --git a/core/common/src/main/java/alluxio/thrift/LockBlockResult.java b/core/common/src/main/java/alluxio/thrift/LockBlockResult.java index 72525da9faf1..8b6ac6104026 100644 --- a/core/common/src/main/java/alluxio/thrift/LockBlockResult.java +++ b/core/common/src/main/java/alluxio/thrift/LockBlockResult.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class LockBlockResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LockBlockResult"); diff --git a/core/common/src/main/java/alluxio/thrift/MountTOptions.java b/core/common/src/main/java/alluxio/thrift/MountTOptions.java index 4bdcf4b49859..c8cdc333c876 100644 --- a/core/common/src/main/java/alluxio/thrift/MountTOptions.java +++ b/core/common/src/main/java/alluxio/thrift/MountTOptions.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class MountTOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MountTOptions"); diff --git a/core/common/src/main/java/alluxio/thrift/PersistCommandOptions.java b/core/common/src/main/java/alluxio/thrift/PersistCommandOptions.java index f8a434c9b596..0a9a5711f883 100644 --- a/core/common/src/main/java/alluxio/thrift/PersistCommandOptions.java +++ b/core/common/src/main/java/alluxio/thrift/PersistCommandOptions.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class PersistCommandOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PersistCommandOptions"); diff --git a/core/common/src/main/java/alluxio/thrift/PersistFile.java b/core/common/src/main/java/alluxio/thrift/PersistFile.java index bd6a474dab6d..ff072c3485a8 100644 --- a/core/common/src/main/java/alluxio/thrift/PersistFile.java +++ b/core/common/src/main/java/alluxio/thrift/PersistFile.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class PersistFile implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PersistFile"); diff --git a/core/common/src/main/java/alluxio/thrift/RpcOptions.java b/core/common/src/main/java/alluxio/thrift/RpcOptions.java index 1cf5e61a0fff..45cfa89c5f92 100644 --- a/core/common/src/main/java/alluxio/thrift/RpcOptions.java +++ b/core/common/src/main/java/alluxio/thrift/RpcOptions.java @@ -37,7 +37,7 @@ /** * Information about the RPC. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class RpcOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RpcOptions"); diff --git a/core/common/src/main/java/alluxio/thrift/SetAttributeTOptions.java b/core/common/src/main/java/alluxio/thrift/SetAttributeTOptions.java index 71279c7d4deb..5925ec003e41 100644 --- a/core/common/src/main/java/alluxio/thrift/SetAttributeTOptions.java +++ b/core/common/src/main/java/alluxio/thrift/SetAttributeTOptions.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class SetAttributeTOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetAttributeTOptions"); diff --git a/core/common/src/main/java/alluxio/thrift/ThriftIOException.java b/core/common/src/main/java/alluxio/thrift/ThriftIOException.java index 041f7e2849ba..d579f25015e6 100644 --- a/core/common/src/main/java/alluxio/thrift/ThriftIOException.java +++ b/core/common/src/main/java/alluxio/thrift/ThriftIOException.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class ThriftIOException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftIOException"); diff --git a/core/common/src/main/java/alluxio/thrift/WorkerInfo.java b/core/common/src/main/java/alluxio/thrift/WorkerInfo.java index 3b0ef2809e48..16a1b5c65344 100644 --- a/core/common/src/main/java/alluxio/thrift/WorkerInfo.java +++ b/core/common/src/main/java/alluxio/thrift/WorkerInfo.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class WorkerInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerInfo"); diff --git a/core/common/src/main/java/alluxio/thrift/WorkerNetAddress.java b/core/common/src/main/java/alluxio/thrift/WorkerNetAddress.java index 51a7560b5921..8be75a287f21 100644 --- a/core/common/src/main/java/alluxio/thrift/WorkerNetAddress.java +++ b/core/common/src/main/java/alluxio/thrift/WorkerNetAddress.java @@ -37,7 +37,7 @@ /** * Address information about workers. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class WorkerNetAddress implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerNetAddress"); diff --git a/core/common/src/thrift/file_system_master.thrift b/core/common/src/thrift/file_system_master.thrift index 7a57e3e4fcf0..532986d05b8d 100644 --- a/core/common/src/thrift/file_system_master.thrift +++ b/core/common/src/thrift/file_system_master.thrift @@ -25,6 +25,11 @@ struct MountTOptions { 2: optional map properties } +struct LoadMetadataTOptions { + 1: optional bool recursive + 2: optional bool loadDirectChildren +} + /** * Contains the information of a block in a file. In addition to the BlockInfo, it includes the * offset in the file, and the under file system locations of the block replicas. @@ -169,7 +174,7 @@ service FileSystemMasterClientService extends common.AlluxioService { */ // TODO(jiri): Get rid of this. i64 loadMetadata( /** the path of the under file system */ 1: string ufsPath, - /** whether to load meta data recursively */ 2: bool recursive) + /** whether to load meta data recursively */ 2: LoadMetadataTOptions options) throws (1: exception.AlluxioTException e, 2: exception.ThriftIOException ioe) /** diff --git a/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java b/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java index e928f8e638c3..08e2daf24aee 100644 --- a/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java +++ b/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java @@ -49,6 +49,7 @@ import alluxio.master.file.options.CreateDirectoryOptions; import alluxio.master.file.options.CreateFileOptions; import alluxio.master.file.options.CreatePathOptions; +import alluxio.master.file.options.LoadMetadataOptions; import alluxio.master.file.options.MountOptions; import alluxio.master.file.options.SetAttributeOptions; import alluxio.master.journal.Journal; @@ -76,6 +77,7 @@ import alluxio.thrift.FileSystemCommandOptions; import alluxio.thrift.FileSystemMasterClientService; import alluxio.thrift.FileSystemMasterWorkerService; +import alluxio.thrift.LoadMetadataTOptions; import alluxio.thrift.PersistCommandOptions; import alluxio.thrift.PersistFile; import alluxio.underfs.UnderFileSystem; @@ -334,7 +336,7 @@ public long getFileId(AlluxioURI path) throws AccessControlException, FileDoesNo mPermissionChecker.checkPermission(FileSystemAction.READ, path); if (!mInodeTree.inodePathExists(path)) { try { - return loadMetadata(path, true); + return loadMetadata(path, LoadMetadataOptions.defaults().setRecursive(true)); } catch (Exception e) { return IdUtils.INVALID_FILE_ID; } @@ -383,6 +385,16 @@ public FileInfo getFileInfo(AlluxioURI path) mPermissionChecker.checkPermission(FileSystemAction.READ, path); // getFileInfo should load from ufs if the file does not exist getFileId(path); + + if (!mInodeTree.inodePathExists(path)) { + try { + loadMetadata(path, LoadMetadataOptions.defaults().setRecursive(true)); + } catch (Exception e) { + // TODO(peis): consider throw an metadata loading failure exception here. + LOG.error("Failed to load metadata at {}", path, e); + } + } + Inode inode = mInodeTree.getInodeByPath(path); return getFileInfoInternal(inode); } @@ -455,13 +467,28 @@ public List getFileInfoList(AlluxioURI path) MasterContext.getMasterSource().incGetFileInfoOps(1); synchronized (mInodeTree) { mPermissionChecker.checkPermission(FileSystemAction.READ, path); - // getFileInfoList should load from ufs if the file does not exist - getFileId(path); - Inode inode = mInodeTree.getInodeByPath(path); + + LoadMetadataOptions loadMetadataOptions = LoadMetadataOptions.defaults().setRecursive(true); + Inode inode = null; + if (mInodeTree.inodePathExists(path)) { + inode = mInodeTree.getInodeByPath(path); + if (inode.isDirectory() && ((InodeDirectory) inode).isDirectChildrenLoaded()) { + mPermissionChecker.checkPermission(FileSystemAction.EXECUTE, path); + loadMetadataOptions.setLoadDirectChildren(true); + } + } + try { + loadMetadata(path, loadMetadataOptions); + } catch (Exception e) { + LOG.error("Failed to load metadata at {}.", path, e); + } + + if (inode != null) { + inode = mInodeTree.getInodeByPath(path); + } List ret = new ArrayList<>(); if (inode.isDirectory()) { - mPermissionChecker.checkPermission(FileSystemAction.EXECUTE, path); for (Inode child : ((InodeDirectory) inode).getChildren()) { ret.add(getFileInfoInternal(child)); } @@ -1487,10 +1514,9 @@ public void reportLostFile(long fileId) throws FileDoesNotExistException { * parent path if path is a directory. * * @param path the path for which metadata should be loaded - * @param recursive whether parent directories should be created if they do not already exist + * @param options the load metadata options * @return the file id of the loaded path * @throws BlockInfoException if an invalid block size is encountered - * @throws FileAlreadyExistsException if the object to be loaded already exists * @throws FileDoesNotExistException if there is no UFS path * @throws InvalidPathException if invalid path is encountered * @throws InvalidFileSizeException if invalid file size is encountered @@ -1499,10 +1525,9 @@ public void reportLostFile(long fileId) throws FileDoesNotExistException { * @throws AccessControlException if permission checking fails */ // TODO(jiri): Make it possible to load UFS objects recursively. - public long loadMetadata(AlluxioURI path, boolean recursive) - throws BlockInfoException, FileAlreadyExistsException, FileDoesNotExistException, - InvalidPathException, InvalidFileSizeException, FileAlreadyCompletedException, IOException, - AccessControlException { + public long loadMetadata(AlluxioURI path, LoadMetadataOptions options) + throws BlockInfoException, FileDoesNotExistException, InvalidPathException, + InvalidFileSizeException, FileAlreadyCompletedException, IOException, AccessControlException { MountTable.Resolution resolution; synchronized (mInodeTree) { // Permission checking is not performed in this method, but in the methods invoked. @@ -1516,46 +1541,100 @@ public long loadMetadata(AlluxioURI path, boolean recursive) ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage(path.getPath())); } if (ufs.isFile(ufsUri.toString())) { - long ufsBlockSizeByte = ufs.getBlockSizeByte(ufsUri.toString()); - long ufsLength = ufs.getFileSize(ufsUri.toString()); - // Metadata loaded from UFS has no TTL set. - CreateFileOptions options = - CreateFileOptions.defaults().setBlockSizeBytes(ufsBlockSizeByte).setRecursive(recursive) - .setMetadataLoad(true).setPersisted(true); - long fileId = createFile(path, options); - CompleteFileOptions completeOptions = - CompleteFileOptions.defaults().setUfsLength(ufsLength); - completeFile(path, completeOptions); - return fileId; + synchronized (mInodeTree) { + return loadFileMetadata(path, resolution, options); + } + } else { + synchronized (mInodeTree) { + long fileId = loadDirectoryMetadata(path, options); + InodeDirectory inode = (InodeDirectory) mInodeTree.getInodeById(fileId); + if (!inode.isDirectChildrenLoaded() && options.isLoadDirectChildren()) { + String[] files = ufs.list(ufsUri.getPath()); + LoadMetadataOptions loadMetadataOptions = LoadMetadataOptions.defaults(); + for (int i = 0; i < files.length; i++) { + loadMetadata(path.join(files[i]), loadMetadataOptions); + } + inode.isDirectChildrenLoaded(); + } + return fileId; + } } - return loadDirectoryMetadata(path, recursive); } catch (IOException e) { LOG.error(ExceptionUtils.getStackTrace(e)); throw e; } } + /** + * Loads metadata for the file identified by the given path from UFS into Alluxio. + * + * @param path the path for which metadata should be loaded + * @param resolution the UFS resolution of path + * @param options the load metadata options + * @return the file id of the loaded file + * @throws BlockInfoException if an invalid block size is encountered + * @throws FileDoesNotExistException if there is no UFS path + * @throws InvalidPathException if invalid path is encountered + * @throws InvalidFileSizeException if invalid file size is encountered + * @throws FileAlreadyCompletedException if the file is already completed + * @throws IOException if an I/O error occurs + * @throws AccessControlException if permission checking fails + */ + @GuardedBy("mInodeTree") + private long loadFileMetadata(AlluxioURI path, MountTable.Resolution resolution, + LoadMetadataOptions options) + throws IOException, BlockInfoException, FileDoesNotExistException, InvalidPathException, + AccessControlException, FileAlreadyCompletedException, InvalidFileSizeException { + if (mInodeTree.inodePathExists(path)) { + return mInodeTree.getInodeByPath(path).getId(); + } + AlluxioURI ufsUri = resolution.getUri(); + UnderFileSystem ufs = resolution.getUfs(); + + long ufsBlockSizeByte = ufs.getBlockSizeByte(ufsUri.toString()); + long ufsLength = ufs.getFileSize(ufsUri.toString()); + // Metadata loaded from UFS has no TTL set. + CreateFileOptions createFileOptions = + CreateFileOptions.defaults().setBlockSizeBytes(ufsBlockSizeByte) + .setRecursive(options.isRecursive()).setMetadataLoad(true).setPersisted(true); + try { + long fileId = createFile(path, createFileOptions); + CompleteFileOptions completeOptions = CompleteFileOptions.defaults().setUfsLength(ufsLength); + completeFile(path, completeOptions); + return mInodeTree.getInodeById(fileId).getId(); + } catch (FileAlreadyExistsException e) { + LOG.error("FileAlreadyExistsException seen unexpectedly.", e); + throw Throwables.propagate(e); + } + } + /** * Loads metadata for the directory identified by the given path from UFS into Alluxio. This does * not actually require looking at the UFS path. * * @param path the path for which metadata should be loaded - * @param recursive whether parent directories should be created if they do not already exist + * @param options the load metadata options * @return the file id of the loaded directory - * @throws FileAlreadyExistsException if the object to be loaded already exists * @throws InvalidPathException if invalid path is encountered * @throws IOException if an I/O error occurs * * @throws AccessControlException if permission checking fails * @throws FileDoesNotExistException if the path does not exist */ @GuardedBy("mInodeTree") - private long loadDirectoryMetadata(AlluxioURI path, boolean recursive) - throws IOException, FileAlreadyExistsException, InvalidPathException, AccessControlException, - FileDoesNotExistException { - CreateDirectoryOptions options = + private long loadDirectoryMetadata(AlluxioURI path, LoadMetadataOptions options) + throws IOException, InvalidPathException, AccessControlException, FileDoesNotExistException { + if (mInodeTree.inodePathExists(path)) { + return mInodeTree.getInodeByPath(path).getId(); + } + CreateDirectoryOptions createDirectoryOptions = CreateDirectoryOptions.defaults().setMountPoint(mMountTable.isMountPoint(path)) - .setPersisted(true).setRecursive(recursive).setMetadataLoad(true); - InodeTree.CreatePathResult result = createDirectory(path, options); + .setPersisted(true).setRecursive(options.isRecursive()).setMetadataLoad(true); + InodeTree.CreatePathResult result; + try { + result = createDirectory(path, createDirectoryOptions); + } catch (FileAlreadyExistsException e) { + throw Throwables.propagate(e); + } List> inodes = null; if (result.getCreated().size() > 0) { inodes = result.getCreated(); @@ -1565,7 +1644,8 @@ private long loadDirectoryMetadata(AlluxioURI path, boolean recursive) inodes = result.getModified(); } if (inodes == null) { - throw new FileAlreadyExistsException(ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(path)); + throw Throwables.propagate( + new FileAlreadyExistsException(ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(path))); } return inodes.get(inodes.size() - 1).getId(); } @@ -1609,7 +1689,7 @@ public void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, MountOptions optio boolean loadMetadataSuceeded = false; try { // This will create the directory at alluxioPath - loadDirectoryMetadata(alluxioPath, false); + loadDirectoryMetadata(alluxioPath, LoadMetadataOptions.defaults().setRecursive(false)); loadMetadataSuceeded = true; } catch (FileDoesNotExistException e) { // This exception should be impossible since we just mounted this path diff --git a/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java b/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java index 63022e051d86..c0bed1c022fe 100644 --- a/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java +++ b/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientRestServiceHandler.java @@ -19,6 +19,7 @@ import alluxio.master.file.options.CompleteFileOptions; import alluxio.master.file.options.CreateDirectoryOptions; import alluxio.master.file.options.CreateFileOptions; +import alluxio.master.file.options.LoadMetadataOptions; import alluxio.master.file.options.MountOptions; import alluxio.master.file.options.SetAttributeOptions; @@ -276,8 +277,8 @@ public Response loadMetadata(@QueryParam("path") String path, @QueryParam("recursive") boolean recursive) { try { Preconditions.checkNotNull(path, "required 'path' parameter is missing"); - return RestUtils - .createResponse(mFileSystemMaster.loadMetadata(new AlluxioURI(path), recursive)); + return RestUtils.createResponse(mFileSystemMaster.loadMetadata(new AlluxioURI(path), + LoadMetadataOptions.defaults().setRecursive(recursive))); } catch (AlluxioException | IOException | NullPointerException e) { LOG.warn(e.getMessage()); return RestUtils.createErrorResponse(e.getMessage()); diff --git a/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientServiceHandler.java b/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientServiceHandler.java index e42425a6ed74..f0bef30159f7 100644 --- a/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientServiceHandler.java +++ b/core/server/src/main/java/alluxio/master/file/FileSystemMasterClientServiceHandler.java @@ -20,6 +20,7 @@ import alluxio.master.file.options.CompleteFileOptions; import alluxio.master.file.options.CreateDirectoryOptions; import alluxio.master.file.options.CreateFileOptions; +import alluxio.master.file.options.LoadMetadataOptions; import alluxio.master.file.options.MountOptions; import alluxio.master.file.options.SetAttributeOptions; import alluxio.thrift.AlluxioTException; @@ -29,6 +30,7 @@ import alluxio.thrift.FileBlockInfo; import alluxio.thrift.FileInfo; import alluxio.thrift.FileSystemMasterClientService; +import alluxio.thrift.LoadMetadataTOptions; import alluxio.thrift.MountTOptions; import alluxio.thrift.SetAttributeTOptions; import alluxio.thrift.ThriftIOException; @@ -198,12 +200,13 @@ public List call() throws AlluxioException { } @Override - public long loadMetadata(final String alluxioPath, final boolean recursive) + public long loadMetadata(final String alluxioPath, final LoadMetadataTOptions options) throws AlluxioTException, ThriftIOException { return RpcUtils.call(new RpcCallableThrowsIOException() { @Override public Long call() throws AlluxioException, IOException { - return mFileSystemMaster.loadMetadata(new AlluxioURI(alluxioPath), recursive); + return mFileSystemMaster + .loadMetadata(new AlluxioURI(alluxioPath), new LoadMetadataOptions(options)); } }); } diff --git a/core/server/src/main/java/alluxio/master/file/meta/InodeDirectory.java b/core/server/src/main/java/alluxio/master/file/meta/InodeDirectory.java index d74a020653c3..e41b368168a5 100644 --- a/core/server/src/main/java/alluxio/master/file/meta/InodeDirectory.java +++ b/core/server/src/main/java/alluxio/master/file/meta/InodeDirectory.java @@ -51,6 +51,8 @@ public Object getFieldValue(Inode o) { private boolean mMountPoint; + private boolean mDirectChildrenLoaded; + /** * Creates a new instance of {@link InodeDirectory}. * @@ -65,6 +67,8 @@ private InodeDirectory(long id) { private InodeDirectory(long id, long creationTimeMs) { this(id); mCreationTimeMs = creationTimeMs; + + mDirectChildrenLoaded = false; } @Override @@ -129,6 +133,13 @@ public synchronized boolean isMountPoint() { return mMountPoint; } + /** + * @return true if we have loaded all the direct children's metadata once + */ + public synchronized boolean isDirectChildrenLoaded() { + return mDirectChildrenLoaded; + } + /** * Removes the given inode from the directory. * @@ -155,7 +166,12 @@ public synchronized boolean removeChild(String name) { */ public synchronized InodeDirectory setMountPoint(boolean mountPoint) { mMountPoint = mountPoint; - return this; + return getThis(); + } + + public synchronized InodeDirectory setDirectChildrenLoaded(boolean directChildrenLoaded) { + mDirectChildrenLoaded = directChildrenLoaded; + return getThis(); } /** @@ -210,7 +226,8 @@ public static InodeDirectory fromJournalEntry(InodeDirectoryEntry entry) { .setPinned(entry.getPinned()) .setLastModificationTimeMs(entry.getLastModificationTimeMs()) .setPermissionStatus(permissionStatus) - .setMountPoint(entry.getMountPoint()); + .setMountPoint(entry.getMountPoint()) + .setDirectChildrenLoaded(entry.getDirectChildrenLoaded()); return inode; } @@ -249,6 +266,7 @@ public synchronized JournalEntry toJournalEntry() { .setGroupName(getGroupName()) .setPermission(getPermission()) .setMountPoint(isMountPoint()) + .setDirectChildrenLoaded(isDirectChildrenLoaded()) .build(); return JournalEntry.newBuilder().setInodeDirectory(inodeDirectory).build(); } diff --git a/core/server/src/main/java/alluxio/master/file/options/LoadMetadataOptions.java b/core/server/src/main/java/alluxio/master/file/options/LoadMetadataOptions.java new file mode 100644 index 000000000000..c9eec021bdea --- /dev/null +++ b/core/server/src/main/java/alluxio/master/file/options/LoadMetadataOptions.java @@ -0,0 +1,95 @@ +package alluxio.master.file.options; + +import alluxio.thrift.LoadMetadataTOptions; + +import com.google.common.base.Objects; + +import javax.annotation.concurrent.NotThreadSafe; + +@NotThreadSafe +public final class LoadMetadataOptions { + private boolean mRecursive; + private boolean mLoadDirectChildren; + + /** + * @return the default {@link LoadMetadataOptions} + */ + public static LoadMetadataOptions defaults() { + return new LoadMetadataOptions(); + } + + private LoadMetadataOptions() { + mRecursive = false; + mLoadDirectChildren = false; + } + + public LoadMetadataOptions(LoadMetadataTOptions options) { + this(); + mRecursive = options.isRecursive(); + mLoadDirectChildren = options.isLoadDirectChildren(); + } + + /** + * @return the recursive flag value; it specifies whether parent directories should be created if + * they do not already exist + */ + public boolean isRecursive() { + return mRecursive; + } + + /** + * @return the load direct children flag. It specifies whether the direct children should + * be loaded. + */ + public boolean isLoadDirectChildren() { + return mLoadDirectChildren; + } + + /** + * Sets the recursive flag. + * + * @param recursive the recursive flag value to use; it specifies whether parent directories + * should be created if they do not already exist + * @return the updated options object + */ + public LoadMetadataOptions setRecursive(boolean recursive) { + mRecursive = recursive; + return this; + } + + /** + * Sets the load direct children flag. + * + * @param loadDirectChildren the load direct children flag. It specifies whether the direct + * children should be loaded. + * @return the updated object + */ + public LoadMetadataOptions setLoadDirectChildren(boolean loadDirectChildren) { + mLoadDirectChildren = loadDirectChildren; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof LoadMetadataOptions)) { + return false; + } + LoadMetadataOptions that = (LoadMetadataOptions) o; + return Objects.equal(mRecursive, that.mRecursive) + && Objects.equal(mLoadDirectChildren, that.mLoadDirectChildren); + } + + @Override + public int hashCode() { + return Objects.hashCode(mRecursive, mLoadDirectChildren); + } + + @Override + public String toString() { + return Objects.toStringHelper(this).add("recursive", mRecursive) + .add("loadDirectChildren", mLoadDirectChildren).toString(); + } +} \ No newline at end of file diff --git a/core/server/src/main/java/alluxio/proto/journal/File.java b/core/server/src/main/java/alluxio/proto/journal/File.java index 31d91a557f42..ed230d4b1afa 100644 --- a/core/server/src/main/java/alluxio/proto/journal/File.java +++ b/core/server/src/main/java/alluxio/proto/journal/File.java @@ -45,6 +45,7 @@ public interface StringPairEntryOrBuilder extends * *
    * A pair of strings, useful for maps.
+   * next available id: 3
    * 
*/ public static final class StringPairEntry extends @@ -355,6 +356,7 @@ protected Builder newBuilderForType( * *
      * A pair of strings, useful for maps.
+     * next available id: 3
      * 
*/ public static final class Builder extends @@ -4016,6 +4018,15 @@ public interface InodeDirectoryEntryOrBuilder extends * optional bool mount_point = 11; */ boolean getMountPoint(); + + /** + * optional bool direct_children_loaded = 12; + */ + boolean hasDirectChildrenLoaded(); + /** + * optional bool direct_children_loaded = 12; + */ + boolean getDirectChildrenLoaded(); } /** * Protobuf type {@code alluxio.proto.journal.InodeDirectoryEntry} @@ -4132,6 +4143,11 @@ private InodeDirectoryEntry( mountPoint_ = input.readBool(); break; } + case 96: { + bitField0_ |= 0x00000800; + directChildrenLoaded_ = input.readBool(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -4445,6 +4461,21 @@ public boolean getMountPoint() { return mountPoint_; } + public static final int DIRECT_CHILDREN_LOADED_FIELD_NUMBER = 12; + private boolean directChildrenLoaded_; + /** + * optional bool direct_children_loaded = 12; + */ + public boolean hasDirectChildrenLoaded() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional bool direct_children_loaded = 12; + */ + public boolean getDirectChildrenLoaded() { + return directChildrenLoaded_; + } + private void initFields() { id_ = 0L; parentId_ = 0L; @@ -4457,6 +4488,7 @@ private void initFields() { groupName_ = ""; permission_ = 0; mountPoint_ = false; + directChildrenLoaded_ = false; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -4504,6 +4536,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000400) == 0x00000400)) { output.writeBool(11, mountPoint_); } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + output.writeBool(12, directChildrenLoaded_); + } getUnknownFields().writeTo(output); } @@ -4557,6 +4592,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBoolSize(11, mountPoint_); } + if (((bitField0_ & 0x00000800) == 0x00000800)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, directChildrenLoaded_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -4700,6 +4739,8 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000200); mountPoint_ = false; bitField0_ = (bitField0_ & ~0x00000400); + directChildrenLoaded_ = false; + bitField0_ = (bitField0_ & ~0x00000800); return this; } @@ -4772,6 +4813,10 @@ public alluxio.proto.journal.File.InodeDirectoryEntry buildPartial() { to_bitField0_ |= 0x00000400; } result.mountPoint_ = mountPoint_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000800; + } + result.directChildrenLoaded_ = directChildrenLoaded_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -4829,6 +4874,9 @@ public Builder mergeFrom(alluxio.proto.journal.File.InodeDirectoryEntry other) { if (other.hasMountPoint()) { setMountPoint(other.getMountPoint()); } + if (other.hasDirectChildrenLoaded()) { + setDirectChildrenLoaded(other.getDirectChildrenLoaded()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -5384,6 +5432,38 @@ public Builder clearMountPoint() { return this; } + private boolean directChildrenLoaded_ ; + /** + * optional bool direct_children_loaded = 12; + */ + public boolean hasDirectChildrenLoaded() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional bool direct_children_loaded = 12; + */ + public boolean getDirectChildrenLoaded() { + return directChildrenLoaded_; + } + /** + * optional bool direct_children_loaded = 12; + */ + public Builder setDirectChildrenLoaded(boolean value) { + bitField0_ |= 0x00000800; + directChildrenLoaded_ = value; + onChanged(); + return this; + } + /** + * optional bool direct_children_loaded = 12; + */ + public Builder clearDirectChildrenLoaded() { + bitField0_ = (bitField0_ & ~0x00000800); + directChildrenLoaded_ = false; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:alluxio.proto.journal.InodeDirectoryEntry) } @@ -11779,36 +11859,37 @@ public Builder clearPermission() { "\022\016\n\006length\030\003 \001(\003\022\022\n\nop_time_ms\030\004 \001(\003\"D\n\017" + "DeleteFileEntry\022\n\n\002id\030\001 \001(\003\022\021\n\trecursive", "\030\002 \001(\010\022\022\n\nop_time_ms\030\003 \001(\003\"-\n\025DeleteMoun" + - "tPointEntry\022\024\n\014alluxio_path\030\001 \001(\t\"\372\001\n\023In" + + "tPointEntry\022\024\n\014alluxio_path\030\001 \001(\t\"\232\002\n\023In" + "odeDirectoryEntry\022\n\n\002id\030\001 \001(\003\022\021\n\tparent_" + "id\030\002 \001(\003\022\014\n\004name\030\003 \001(\t\022\031\n\021persistence_st" + "ate\030\004 \001(\t\022\016\n\006pinned\030\005 \001(\010\022\030\n\020creation_ti" + "me_ms\030\006 \001(\003\022!\n\031last_modification_time_ms" + "\030\007 \001(\003\022\021\n\tuser_name\030\010 \001(\t\022\022\n\ngroup_name\030" + "\t \001(\t\022\022\n\npermission\030\n \001(\005\022\023\n\013mount_point" + - "\030\013 \001(\010\"O\n\036InodeDirectoryIdGeneratorEntry" + - "\022\024\n\014container_id\030\001 \001(\003\022\027\n\017sequence_numbe", - "r\030\002 \001(\003\"\315\002\n\016InodeFileEntry\022\n\n\002id\030\001 \001(\003\022\021" + - "\n\tparent_id\030\002 \001(\003\022\014\n\004name\030\003 \001(\t\022\031\n\021persi" + - "stence_state\030\004 \001(\t\022\016\n\006pinned\030\005 \001(\010\022\030\n\020cr" + - "eation_time_ms\030\006 \001(\003\022!\n\031last_modificatio" + - "n_time_ms\030\007 \001(\003\022\030\n\020block_size_bytes\030\010 \001(" + - "\003\022\016\n\006length\030\t \001(\003\022\021\n\tcompleted\030\n \001(\010\022\021\n\t" + - "cacheable\030\013 \001(\010\022\016\n\006blocks\030\014 \003(\003\022\013\n\003ttl\030\r" + - " \001(\003\022\021\n\tuser_name\030\016 \001(\t\022\022\n\ngroup_name\030\017 " + - "\001(\t\022\022\n\npermission\030\020 \001(\005\"O\n\036InodeLastModi" + - "ficationTimeEntry\022\n\n\002id\030\001 \001(\003\022!\n\031last_mo", - "dification_time_ms\030\002 \001(\003\"#\n\025PersistDirec" + - "toryEntry\022\n\n\002id\030\001 \001(\003\"B\n\020PersistFileEntr" + - "y\022\n\n\002id\030\001 \001(\003\022\016\n\006length\030\002 \001(\003\022\022\n\nop_time" + - "_ms\030\003 \001(\003\"L\n\025ReinitializeFileEntry\022\014\n\004pa" + - "th\030\001 \001(\t\022\030\n\020block_size_bytes\030\002 \001(\003\022\013\n\003tt" + - "l\030\003 \001(\003\"?\n\013RenameEntry\022\n\n\002id\030\001 \001(\003\022\020\n\010ds" + - "t_path\030\002 \001(\t\022\022\n\nop_time_ms\030\003 \001(\003\"\225\001\n\021Set" + - "AttributeEntry\022\n\n\002id\030\001 \001(\003\022\022\n\nop_time_ms" + - "\030\002 \001(\003\022\016\n\006pinned\030\003 \001(\010\022\013\n\003ttl\030\004 \001(\003\022\021\n\tp" + - "ersisted\030\005 \001(\010\022\r\n\005owner\030\006 \001(\t\022\r\n\005group\030\007", - " \001(\t\022\022\n\npermission\030\010 \001(\005" + "\030\013 \001(\010\022\036\n\026direct_children_loaded\030\014 \001(\010\"O" + + "\n\036InodeDirectoryIdGeneratorEntry\022\024\n\014cont", + "ainer_id\030\001 \001(\003\022\027\n\017sequence_number\030\002 \001(\003\"" + + "\315\002\n\016InodeFileEntry\022\n\n\002id\030\001 \001(\003\022\021\n\tparent" + + "_id\030\002 \001(\003\022\014\n\004name\030\003 \001(\t\022\031\n\021persistence_s" + + "tate\030\004 \001(\t\022\016\n\006pinned\030\005 \001(\010\022\030\n\020creation_t" + + "ime_ms\030\006 \001(\003\022!\n\031last_modification_time_m" + + "s\030\007 \001(\003\022\030\n\020block_size_bytes\030\010 \001(\003\022\016\n\006len" + + "gth\030\t \001(\003\022\021\n\tcompleted\030\n \001(\010\022\021\n\tcacheabl" + + "e\030\013 \001(\010\022\016\n\006blocks\030\014 \003(\003\022\013\n\003ttl\030\r \001(\003\022\021\n\t" + + "user_name\030\016 \001(\t\022\022\n\ngroup_name\030\017 \001(\t\022\022\n\np" + + "ermission\030\020 \001(\005\"O\n\036InodeLastModification", + "TimeEntry\022\n\n\002id\030\001 \001(\003\022!\n\031last_modificati" + + "on_time_ms\030\002 \001(\003\"#\n\025PersistDirectoryEntr" + + "y\022\n\n\002id\030\001 \001(\003\"B\n\020PersistFileEntry\022\n\n\002id\030" + + "\001 \001(\003\022\016\n\006length\030\002 \001(\003\022\022\n\nop_time_ms\030\003 \001(" + + "\003\"L\n\025ReinitializeFileEntry\022\014\n\004path\030\001 \001(\t" + + "\022\030\n\020block_size_bytes\030\002 \001(\003\022\013\n\003ttl\030\003 \001(\003\"" + + "?\n\013RenameEntry\022\n\n\002id\030\001 \001(\003\022\020\n\010dst_path\030\002" + + " \001(\t\022\022\n\nop_time_ms\030\003 \001(\003\"\225\001\n\021SetAttribut" + + "eEntry\022\n\n\002id\030\001 \001(\003\022\022\n\nop_time_ms\030\002 \001(\003\022\016" + + "\n\006pinned\030\003 \001(\010\022\013\n\003ttl\030\004 \001(\003\022\021\n\tpersisted", + "\030\005 \001(\010\022\r\n\005owner\030\006 \001(\t\022\r\n\005group\030\007 \001(\t\022\022\n\n" + + "permission\030\010 \001(\005" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -11863,7 +11944,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_alluxio_proto_journal_InodeDirectoryEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_alluxio_proto_journal_InodeDirectoryEntry_descriptor, - new java.lang.String[] { "Id", "ParentId", "Name", "PersistenceState", "Pinned", "CreationTimeMs", "LastModificationTimeMs", "UserName", "GroupName", "Permission", "MountPoint", }); + new java.lang.String[] { "Id", "ParentId", "Name", "PersistenceState", "Pinned", "CreationTimeMs", "LastModificationTimeMs", "UserName", "GroupName", "Permission", "MountPoint", "DirectChildrenLoaded", }); internal_static_alluxio_proto_journal_InodeDirectoryIdGeneratorEntry_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_alluxio_proto_journal_InodeDirectoryIdGeneratorEntry_fieldAccessorTable = new diff --git a/core/server/src/proto/journal/file.proto b/core/server/src/proto/journal/file.proto index bb8bc9b31466..f0d8b3ff8d42 100644 --- a/core/server/src/proto/journal/file.proto +++ b/core/server/src/proto/journal/file.proto @@ -57,6 +57,7 @@ message InodeDirectoryEntry { optional string group_name = 9; optional int32 permission = 10; optional bool mount_point = 11; + optional bool direct_children_loaded = 12; } // next available id: 3 diff --git a/keyvalue/common/src/main/java/alluxio/thrift/KeyValueMasterClientService.java b/keyvalue/common/src/main/java/alluxio/thrift/KeyValueMasterClientService.java index 6696e1c363a8..cd0fed563e9d 100644 --- a/keyvalue/common/src/main/java/alluxio/thrift/KeyValueMasterClientService.java +++ b/keyvalue/common/src/main/java/alluxio/thrift/KeyValueMasterClientService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class KeyValueMasterClientService { /** diff --git a/keyvalue/common/src/main/java/alluxio/thrift/KeyValueWorkerClientService.java b/keyvalue/common/src/main/java/alluxio/thrift/KeyValueWorkerClientService.java index 81d72f55afa1..52f8a8e9818f 100644 --- a/keyvalue/common/src/main/java/alluxio/thrift/KeyValueWorkerClientService.java +++ b/keyvalue/common/src/main/java/alluxio/thrift/KeyValueWorkerClientService.java @@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class KeyValueWorkerClientService { public interface Iface extends alluxio.thrift.AlluxioService.Iface { diff --git a/keyvalue/common/src/main/java/alluxio/thrift/PartitionInfo.java b/keyvalue/common/src/main/java/alluxio/thrift/PartitionInfo.java index b7e78845f78f..fea39720591a 100644 --- a/keyvalue/common/src/main/java/alluxio/thrift/PartitionInfo.java +++ b/keyvalue/common/src/main/java/alluxio/thrift/PartitionInfo.java @@ -37,7 +37,7 @@ /** * Information about a key-value partition. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-05") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-11") public class PartitionInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PartitionInfo");