Skip to content

Commit

Permalink
Cleanup ufs descendant sync type
Browse files Browse the repository at this point in the history
  • Loading branch information
gpang authored and aaudiber committed Jan 9, 2018
1 parent 9bebc24 commit e3fff08
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 59 deletions.
Expand Up @@ -70,6 +70,7 @@
import alluxio.master.file.options.CreateDirectoryOptions; import alluxio.master.file.options.CreateDirectoryOptions;
import alluxio.master.file.options.CreateFileOptions; import alluxio.master.file.options.CreateFileOptions;
import alluxio.master.file.options.DeleteOptions; import alluxio.master.file.options.DeleteOptions;
import alluxio.master.file.options.DescendantType;
import alluxio.master.file.options.FreeOptions; import alluxio.master.file.options.FreeOptions;
import alluxio.master.file.options.GetStatusOptions; import alluxio.master.file.options.GetStatusOptions;
import alluxio.master.file.options.ListStatusOptions; import alluxio.master.file.options.ListStatusOptions;
Expand Down Expand Up @@ -749,7 +750,7 @@ public FileInfo getFileInfo(AlluxioURI path, GetStatusOptions options)
throw e; throw e;
} }
// Possible ufs sync. // Possible ufs sync.
if (syncMetadata(journalContext, inodePath, lockingScheme, 1)) { if (syncMetadata(journalContext, inodePath, lockingScheme, DescendantType.ONE)) {
// If synced, do not load metadata. // If synced, do not load metadata.
options.setLoadMetadataType(LoadMetadataType.Never); options.setLoadMetadataType(LoadMetadataType.Never);
} }
Expand Down Expand Up @@ -828,24 +829,25 @@ public List<FileInfo> listStatus(AlluxioURI path, ListStatusOptions listStatusOp
throw e; throw e;
} }
// Possible ufs sync. // Possible ufs sync.
if (syncMetadata(journalContext, inodePath, lockingScheme, 1)) { if (syncMetadata(journalContext, inodePath, lockingScheme, DescendantType.ONE)) {
// If synced, do not load metadata. // If synced, do not load metadata.
listStatusOptions.setLoadMetadataType(LoadMetadataType.Never); listStatusOptions.setLoadMetadataType(LoadMetadataType.Never);
} }


// load metadata for 1 level of descendants // load metadata for 1 level of descendants
int loadDescendantLevels = DescendantType loadDescendantType =
(listStatusOptions.getLoadMetadataType() != LoadMetadataType.Never) ? 1 : 0; (listStatusOptions.getLoadMetadataType() != LoadMetadataType.Never) ? DescendantType.ONE :
DescendantType.NONE;
LoadMetadataOptions loadMetadataOptions = LoadMetadataOptions loadMetadataOptions =
LoadMetadataOptions.defaults().setCreateAncestors(true) LoadMetadataOptions.defaults().setCreateAncestors(true)
.setLoadDescendantLevels(loadDescendantLevels); .setLoadDescendantType(loadDescendantType);
Inode<?> inode; Inode<?> inode;
if (inodePath.fullPathExists()) { if (inodePath.fullPathExists()) {
inode = inodePath.getInode(); inode = inodePath.getInode();
if (inode.isDirectory() if (inode.isDirectory()
&& listStatusOptions.getLoadMetadataType() != LoadMetadataType.Always && listStatusOptions.getLoadMetadataType() != LoadMetadataType.Always
&& ((InodeDirectory) inode).isDirectChildrenLoaded()) { && ((InodeDirectory) inode).isDirectChildrenLoaded()) {
loadMetadataOptions.setLoadDescendantLevels(0); loadMetadataOptions.setLoadDescendantType(DescendantType.NONE);
} }
} else { } else {
checkLoadMetadataOptions(listStatusOptions.getLoadMetadataType(), inodePath.getUri()); checkLoadMetadataOptions(listStatusOptions.getLoadMetadataType(), inodePath.getUri());
Expand Down Expand Up @@ -946,7 +948,7 @@ public List<AlluxioURI> checkConsistency(AlluxioURI path, CheckConsistencyOption
throw e; throw e;
} }
// Possible ufs sync. // Possible ufs sync.
syncMetadata(journalContext, parent, lockingScheme, -1); syncMetadata(journalContext, parent, lockingScheme, DescendantType.ALL);


try (InodeLockList children = mInodeTree.lockDescendants(parent, InodeTree.LockMode.READ)) { try (InodeLockList children = mInodeTree.lockDescendants(parent, InodeTree.LockMode.READ)) {
if (!checkConsistencyInternal(parent.getInode(), parent.getUri())) { if (!checkConsistencyInternal(parent.getInode(), parent.getUri())) {
Expand Down Expand Up @@ -1170,7 +1172,7 @@ public long createFile(AlluxioURI path, CreateFileOptions options)
throw e; throw e;
} }
// Possible ufs sync. // Possible ufs sync.
syncMetadata(journalContext, inodePath, lockingScheme, 1); syncMetadata(journalContext, inodePath, lockingScheme, DescendantType.ONE);


mMountTable.checkUnderWritableMountPoint(path); mMountTable.checkUnderWritableMountPoint(path);
createFileAndJournal(inodePath, options, journalContext); createFileAndJournal(inodePath, options, journalContext);
Expand Down Expand Up @@ -1350,7 +1352,8 @@ public void delete(AlluxioURI path, DeleteOptions options) throws IOException,
mMountTable.checkUnderWritableMountPoint(path); mMountTable.checkUnderWritableMountPoint(path);
} }
// Possible ufs sync. // Possible ufs sync.
syncMetadata(journalContext, inodePath, lockingScheme, options.isRecursive() ? -1 : 1); syncMetadata(journalContext, inodePath, lockingScheme,
options.isRecursive() ? DescendantType.ALL : DescendantType.ONE);
if (!inodePath.fullPathExists()) { if (!inodePath.fullPathExists()) {
throw new FileDoesNotExistException(ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage(path)); throw new FileDoesNotExistException(ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage(path));
} }
Expand Down Expand Up @@ -1821,7 +1824,7 @@ public long createDirectory(AlluxioURI path, CreateDirectoryOptions options)
throw e; throw e;
} }
// Possible ufs sync. // Possible ufs sync.
syncMetadata(journalContext, inodePath, lockingScheme, 1); syncMetadata(journalContext, inodePath, lockingScheme, DescendantType.ONE);


mMountTable.checkUnderWritableMountPoint(path); mMountTable.checkUnderWritableMountPoint(path);
createDirectoryAndJournal(inodePath, options, journalContext); createDirectoryAndJournal(inodePath, options, journalContext);
Expand Down Expand Up @@ -1919,8 +1922,8 @@ public void rename(AlluxioURI srcPath, AlluxioURI dstPath, RenameOptions options
throw e; throw e;
} }
// Possible ufs sync. // Possible ufs sync.
syncMetadata(journalContext, srcInodePath, srcLockingScheme, 1); syncMetadata(journalContext, srcInodePath, srcLockingScheme, DescendantType.ONE);
syncMetadata(journalContext, dstInodePath, dstLockingScheme, 1); syncMetadata(journalContext, dstInodePath, dstLockingScheme, DescendantType.ONE);


mMountTable.checkUnderWritableMountPoint(srcPath); mMountTable.checkUnderWritableMountPoint(srcPath);
mMountTable.checkUnderWritableMountPoint(dstPath); mMountTable.checkUnderWritableMountPoint(dstPath);
Expand Down Expand Up @@ -2442,26 +2445,25 @@ private void loadMetadataAndJournal(LockedInodePath inodePath, LoadMetadataOptio
loadDirectoryMetadataAndJournal(inodePath, options, journalContext); loadDirectoryMetadataAndJournal(inodePath, options, journalContext);
InodeDirectory inode = (InodeDirectory) inodePath.getInode(); InodeDirectory inode = (InodeDirectory) inodePath.getInode();


if (options.getLoadDescendantLevels() != 0) { if (options.getLoadDescendantType() != DescendantType.NONE) {
UfsStatus[] children = ufs.listStatus(ufsUri.toString()); UfsStatus[] children = ufs.listStatus(ufsUri.toString());
for (UfsStatus childStatus : children) { for (UfsStatus childStatus : children) {
boolean skipExisting = inode.getChild(childStatus.getName()) != null; if (PathUtils.isTemporaryFileName(childStatus.getName())) {
// Do not skip existing directories if there are more descendant levels to load continue;
if (childStatus.isDirectory() && (options.getLoadDescendantLevels() < 0
|| options.getLoadDescendantLevels() > 1)) {
skipExisting = false;
} }
if (PathUtils.isTemporaryFileName(childStatus.getName()) || skipExisting) { if (inode.getChild(childStatus.getName()) != null && (childStatus.isFile()
|| options.getLoadDescendantType() != DescendantType.ALL)) {
// stop traversing if this is an existing file, or an existing directory without
// loading all descendants.
continue; continue;
} }
TempInodePathForChild tempInodePath = TempInodePathForChild tempInodePath =
new TempInodePathForChild(inodePath, childStatus.getName()); new TempInodePathForChild(inodePath, childStatus.getName());
int loadDescendantLevels = options.getLoadDescendantLevels(); DescendantType loadDescendantType =
if (loadDescendantLevels > 0) { (options.getLoadDescendantType() == DescendantType.ONE) ? DescendantType.NONE :
loadDescendantLevels--; DescendantType.ALL;
}
LoadMetadataOptions loadMetadataOptions = LoadMetadataOptions loadMetadataOptions =
LoadMetadataOptions.defaults().setLoadDescendantLevels(loadDescendantLevels) LoadMetadataOptions.defaults().setLoadDescendantType(loadDescendantType)
.setCreateAncestors(false).setUfsStatus(childStatus); .setCreateAncestors(false).setUfsStatus(childStatus);
loadMetadataAndJournal(tempInodePath, loadMetadataOptions, journalContext); loadMetadataAndJournal(tempInodePath, loadMetadataOptions, journalContext);
} }
Expand Down Expand Up @@ -2602,7 +2604,8 @@ private void loadMetadataIfNotExistAndJournal(LockedInodePath inodePath,
if (inodeExists) { if (inodeExists) {
try { try {
Inode<?> inode = inodePath.getInode(); Inode<?> inode = inodePath.getInode();
loadDirectChildren = inode.isDirectory() && (options.getLoadDescendantLevels() != 0); loadDirectChildren =
inode.isDirectory() && (options.getLoadDescendantType() != DescendantType.NONE);
} catch (FileDoesNotExistException e) { } catch (FileDoesNotExistException e) {
// This should never happen. // This should never happen.
throw new RuntimeException(e); throw new RuntimeException(e);
Expand Down Expand Up @@ -2639,7 +2642,7 @@ public void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, MountOptions optio
} }
mMountTable.checkUnderWritableMountPoint(alluxioPath); mMountTable.checkUnderWritableMountPoint(alluxioPath);
// Possible ufs sync. // Possible ufs sync.
syncMetadata(journalContext, inodePath, lockingScheme, 1); syncMetadata(journalContext, inodePath, lockingScheme, DescendantType.ONE);


mountAndJournal(inodePath, ufsPath, options, journalContext); mountAndJournal(inodePath, ufsPath, options, journalContext);
auditContext.setSucceeded(true); auditContext.setSucceeded(true);
Expand Down Expand Up @@ -2905,7 +2908,8 @@ public void setAttribute(AlluxioURI path, SetAttributeOptions options)
throw e; throw e;
} }
// Possible ufs sync. // Possible ufs sync.
syncMetadata(journalContext, inodePath, lockingScheme, options.isRecursive() ? -1 : 1); syncMetadata(journalContext, inodePath, lockingScheme,
options.isRecursive() ? DescendantType.ALL : DescendantType.ONE);
if (!inodePath.fullPathExists()) { if (!inodePath.fullPathExists()) {
throw new FileDoesNotExistException(ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage(path)); throw new FileDoesNotExistException(ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage(path));
} }
Expand Down Expand Up @@ -3058,11 +3062,11 @@ private void scheduleAsyncPersistenceInternal(LockedInodePath inodePath) throws
* @param journalContext the journal context * @param journalContext the journal context
* @param inodePath the Alluxio inode path to sync with UFS * @param inodePath the Alluxio inode path to sync with UFS
* @param lockingScheme the locking scheme used to lock the inode path * @param lockingScheme the locking scheme used to lock the inode path
* @param syncDescendantLevels the number of levels to sync * @param syncDescendantType how to sync descendants
* @return true if the sync was performed successfully, false otherwise (including errors) * @return true if the sync was performed successfully, false otherwise (including errors)
*/ */
private boolean syncMetadata(JournalContext journalContext, LockedInodePath inodePath, private boolean syncMetadata(JournalContext journalContext, LockedInodePath inodePath,
LockingScheme lockingScheme, int syncDescendantLevels) { LockingScheme lockingScheme, DescendantType syncDescendantType) {
if (!lockingScheme.shouldSync()) { if (!lockingScheme.shouldSync()) {
return false; return false;
} }
Expand Down Expand Up @@ -3120,7 +3124,7 @@ private boolean syncMetadata(JournalContext journalContext, LockedInodePath inod
} }


if (syncPlan.toSyncChildren()) { if (syncPlan.toSyncChildren()) {
loadMetadata = syncDirMetadata(journalContext, inodePath, syncDescendantLevels); loadMetadata = syncDirMetadata(journalContext, inodePath, syncDescendantType);
} }
} }
} catch (Exception e) { } catch (Exception e) {
Expand All @@ -3140,7 +3144,7 @@ private boolean syncMetadata(JournalContext journalContext, LockedInodePath inod
if (loadMetadata) { if (loadMetadata) {
try { try {
loadMetadataAndJournal(inodePath, LoadMetadataOptions.defaults().setCreateAncestors(true) loadMetadataAndJournal(inodePath, LoadMetadataOptions.defaults().setCreateAncestors(true)
.setLoadDescendantLevels(syncDescendantLevels), journalContext); .setLoadDescendantType(syncDescendantType), journalContext);
} catch (Exception e) { } catch (Exception e) {
LOG.error("Failed to load metadata for path: {} error: {}", inodePath.getUri(), LOG.error("Failed to load metadata for path: {} error: {}", inodePath.getUri(),
e.toString()); e.toString());
Expand All @@ -3153,9 +3157,10 @@ private boolean syncMetadata(JournalContext journalContext, LockedInodePath inod
} }


private boolean syncDirMetadata(JournalContext journalContext, LockedInodePath inodePath, private boolean syncDirMetadata(JournalContext journalContext, LockedInodePath inodePath,
int syncDescendantLevels) throws FileDoesNotExistException, InvalidPathException, IOException, DescendantType syncDescendantType)
throws FileDoesNotExistException, InvalidPathException, IOException,
DirectoryNotEmptyException { DirectoryNotEmptyException {
if (syncDescendantLevels == 0) { if (syncDescendantType == DescendantType.NONE) {
return false; return false;
} }
MountTable.Resolution resolution = mMountTable.resolve(inodePath.getUri()); MountTable.Resolution resolution = mMountTable.resolve(inodePath.getUri());
Expand Down Expand Up @@ -3222,8 +3227,10 @@ private boolean syncDirMetadata(JournalContext journalContext, LockedInodePath i
tempInodePath.setDescendant(inodeEntry.getValue(), tempInodePath.setDescendant(inodeEntry.getValue(),
inodePath.getUri().join(inodeEntry.getKey())); inodePath.getUri().join(inodeEntry.getKey()));


loadMetadata |= syncDirMetadata(journalContext, tempInodePath, if (syncDescendantType == DescendantType.ALL) {
syncDescendantLevels < 0 ? -1 : syncDescendantLevels - 1); // Recursively sync children
loadMetadata |= syncDirMetadata(journalContext, tempInodePath, DescendantType.ALL);
}
} }
} }
} }
Expand Down
Expand Up @@ -23,6 +23,7 @@
import alluxio.master.file.options.CreateDirectoryOptions; import alluxio.master.file.options.CreateDirectoryOptions;
import alluxio.master.file.options.CreateFileOptions; import alluxio.master.file.options.CreateFileOptions;
import alluxio.master.file.options.DeleteOptions; import alluxio.master.file.options.DeleteOptions;
import alluxio.master.file.options.DescendantType;
import alluxio.master.file.options.FreeOptions; import alluxio.master.file.options.FreeOptions;
import alluxio.master.file.options.GetStatusOptions; import alluxio.master.file.options.GetStatusOptions;
import alluxio.master.file.options.ListStatusOptions; import alluxio.master.file.options.ListStatusOptions;
Expand Down Expand Up @@ -275,7 +276,8 @@ public LoadMetadataTResponse loadMetadata(final String alluxioPath, final boolea
@Override @Override
public LoadMetadataTResponse call() throws AlluxioException, IOException { public LoadMetadataTResponse call() throws AlluxioException, IOException {
return new LoadMetadataTResponse(mFileSystemMaster.loadMetadata(new AlluxioURI(alluxioPath), return new LoadMetadataTResponse(mFileSystemMaster.loadMetadata(new AlluxioURI(alluxioPath),
LoadMetadataOptions.defaults().setCreateAncestors(true).setLoadDescendantLevels(1))); LoadMetadataOptions.defaults().setCreateAncestors(true).setLoadDescendantType(
DescendantType.ONE)));
} }


@Override @Override
Expand Down
@@ -0,0 +1,24 @@
/*
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
* (the "License"). You may not use this work except in compliance with the License, which is
* available at www.apache.org/licenses/LICENSE-2.0
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied, as more fully set forth in the License.
*
* See the NOTICE file distributed with this work for information regarding copyright ownership.
*/

package alluxio.master.file.options;

/**
* Type of descendant level processing for filesystem inodes.
*/
public enum DescendantType {
/** No descendant processing. */
NONE,
/** Process only 1 level of children. */
ONE,
/** Process all descendants. */
ALL,
}
Expand Up @@ -27,13 +27,7 @@
public final class LoadMetadataOptions { public final class LoadMetadataOptions {
private CommonOptions mCommonOptions; private CommonOptions mCommonOptions;
private boolean mCreateAncestors; private boolean mCreateAncestors;
/** private DescendantType mLoadDescendantType;
* The number of descendant levels to load.
* -1: load all levels
* 0: do not load
* 1+: specific number of levels to load
*/
private int mLoadDescendantLevels;
private UfsStatus mUfsStatus; private UfsStatus mUfsStatus;


/** /**
Expand All @@ -48,7 +42,7 @@ private LoadMetadataOptions() {
mCommonOptions = CommonOptions.defaults(); mCommonOptions = CommonOptions.defaults();
mCreateAncestors = false; mCreateAncestors = false;
mUfsStatus = null; mUfsStatus = null;
mLoadDescendantLevels = 0; mLoadDescendantType = DescendantType.NONE;
} }


/** /**
Expand All @@ -71,10 +65,10 @@ public CommonOptions getCommonOptions() {
} }


/** /**
* @return the number of levels of descendants to load (-1 means no loading) * @return the type of descendants to load
*/ */
public int getLoadDescendantLevels() { public DescendantType getLoadDescendantType() {
return mLoadDescendantLevels; return mLoadDescendantType;
} }


/** /**
Expand Down Expand Up @@ -115,11 +109,11 @@ public LoadMetadataOptions setCreateAncestors(boolean createAncestors) {
} }


/** /**
* @param loadDescendantLevels the number of levels of descendants to load (-1 means no loading) * @param loadDescendantType the type of descendants to load
* @return the updated object * @return the updated object
*/ */
public LoadMetadataOptions setLoadDescendantLevels(int loadDescendantLevels) { public LoadMetadataOptions setLoadDescendantType(DescendantType loadDescendantType) {
mLoadDescendantLevels = loadDescendantLevels; mLoadDescendantType = loadDescendantType;
return this; return this;
} }


Expand All @@ -145,21 +139,21 @@ public boolean equals(Object o) {
LoadMetadataOptions that = (LoadMetadataOptions) o; LoadMetadataOptions that = (LoadMetadataOptions) o;
return Objects.equal(mCreateAncestors, that.mCreateAncestors) return Objects.equal(mCreateAncestors, that.mCreateAncestors)
&& Objects.equal(mCommonOptions, that.mCommonOptions) && Objects.equal(mCommonOptions, that.mCommonOptions)
&& Objects.equal(mLoadDescendantLevels, that.mLoadDescendantLevels) && Objects.equal(mLoadDescendantType, that.mLoadDescendantType)
&& Objects.equal(mUfsStatus, that.mUfsStatus); && Objects.equal(mUfsStatus, that.mUfsStatus);
} }


@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hashCode(mCreateAncestors, mLoadDescendantLevels, mUfsStatus, mCommonOptions); return Objects.hashCode(mCreateAncestors, mLoadDescendantType, mUfsStatus, mCommonOptions);
} }


@Override @Override
public String toString() { public String toString() {
return Objects.toStringHelper(this) return Objects.toStringHelper(this)
.add("commonOptions", mCommonOptions) .add("commonOptions", mCommonOptions)
.add("createAncestors", mCreateAncestors) .add("createAncestors", mCreateAncestors)
.add("loadDescendantLevels", mLoadDescendantLevels) .add("loadDescendantLevels", mLoadDescendantType)
.add("ufsStatus", mUfsStatus).toString(); .add("ufsStatus", mUfsStatus).toString();
} }
} }
Expand Up @@ -47,6 +47,7 @@
import alluxio.master.file.options.CreateDirectoryOptions; import alluxio.master.file.options.CreateDirectoryOptions;
import alluxio.master.file.options.CreateFileOptions; import alluxio.master.file.options.CreateFileOptions;
import alluxio.master.file.options.DeleteOptions; import alluxio.master.file.options.DeleteOptions;
import alluxio.master.file.options.DescendantType;
import alluxio.master.file.options.FreeOptions; import alluxio.master.file.options.FreeOptions;
import alluxio.master.file.options.GetStatusOptions; import alluxio.master.file.options.GetStatusOptions;
import alluxio.master.file.options.ListStatusOptions; import alluxio.master.file.options.ListStatusOptions;
Expand Down Expand Up @@ -1848,7 +1849,8 @@ public void testLoadMetadata() throws Exception {


// This should not throw file exists exception those a/f1 is loaded. // This should not throw file exists exception those a/f1 is loaded.
mFileSystemMaster.loadMetadata(new AlluxioURI("alluxio:/a"), mFileSystemMaster.loadMetadata(new AlluxioURI("alluxio:/a"),
LoadMetadataOptions.defaults().setCreateAncestors(true).setLoadDescendantLevels(1)); LoadMetadataOptions.defaults().setCreateAncestors(true).setLoadDescendantType(
DescendantType.ONE));


// TODO(peis): Avoid this hack by adding an option in getFileInfo to skip loading metadata. // TODO(peis): Avoid this hack by adding an option in getFileInfo to skip loading metadata.
try { try {
Expand All @@ -1861,7 +1863,8 @@ public void testLoadMetadata() throws Exception {
} }


mFileSystemMaster.loadMetadata(new AlluxioURI("alluxio:/a"), mFileSystemMaster.loadMetadata(new AlluxioURI("alluxio:/a"),
LoadMetadataOptions.defaults().setCreateAncestors(true).setLoadDescendantLevels(1)); LoadMetadataOptions.defaults().setCreateAncestors(true)
.setLoadDescendantType(DescendantType.ONE));
} }


/** /**
Expand Down
Expand Up @@ -27,19 +27,24 @@ public void defaults() {
LoadMetadataOptions options = LoadMetadataOptions.defaults(); LoadMetadataOptions options = LoadMetadataOptions.defaults();
Assert.assertEquals(false, options.isCreateAncestors()); Assert.assertEquals(false, options.isCreateAncestors());
Assert.assertEquals(null, options.getUfsStatus()); Assert.assertEquals(null, options.getUfsStatus());
Assert.assertEquals(0, options.getLoadDescendantLevels()); Assert.assertEquals(DescendantType.NONE, options.getLoadDescendantType());
} }


@Test @Test
public void fields() { public void fields() {
Random random = new Random(); Random random = new Random();
boolean isCreateAncestors = random.nextBoolean(); boolean isCreateAncestors = random.nextBoolean();
int loadDescendantLevels = random.nextInt();
LoadMetadataOptions options = LoadMetadataOptions.defaults(); LoadMetadataOptions options = LoadMetadataOptions.defaults();
options.setCreateAncestors(isCreateAncestors); options.setCreateAncestors(isCreateAncestors);
options.setLoadDescendantLevels(loadDescendantLevels);
Assert.assertEquals(isCreateAncestors, options.isCreateAncestors()); Assert.assertEquals(isCreateAncestors, options.isCreateAncestors());
Assert.assertEquals(loadDescendantLevels, options.getLoadDescendantLevels());
DescendantType loadDescendantType = DescendantType.ALL;
options.setLoadDescendantType(loadDescendantType);
Assert.assertEquals(loadDescendantType, options.getLoadDescendantType());

loadDescendantType = DescendantType.ONE;
options.setLoadDescendantType(loadDescendantType);
Assert.assertEquals(loadDescendantType, options.getLoadDescendantType());
} }


@Test @Test
Expand Down

0 comments on commit e3fff08

Please sign in to comment.