You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/09/30 14:46:11 UTC
[1/7] ignite git commit: minor (style)
Repository: ignite
Updated Branches:
refs/heads/ignite-1534 9bb441184 -> 9bc077ed0
minor (style)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c2cedb0e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c2cedb0e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c2cedb0e
Branch: refs/heads/ignite-1534
Commit: c2cedb0ed5f54cdbdc60635043555c7c47c04bea
Parents: c517fcf
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Sep 29 16:20:26 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Sep 29 16:20:26 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/internal/util/GridArgumentCheck.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c2cedb0e/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
index 8be3610..f96773e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
@@ -157,8 +157,7 @@ public class GridArgumentCheck {
public static void notNullOrEmpty(String value, String name) {
notNull(value, name);
- if (value.trim().length() == 0) {
+ if (value.trim().length() == 0)
throw new IllegalArgumentException(INVALID_ARG_MSG_PREFIX + name + NOT_NULL_OR_EMPTY_SUFFIX);
- }
}
-}
\ No newline at end of file
+}
[5/7] ignite git commit: IGNITE-1515: Fixed delete.
Posted by sb...@apache.org.
IGNITE-1515: Fixed delete.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/54bb7d76
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/54bb7d76
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/54bb7d76
Branch: refs/heads/ignite-1534
Commit: 54bb7d760d9c1261a64fcf3d0be858be7b14444e
Parents: be906e3
Author: iveselovskiy <iv...@gridgain.com>
Authored: Wed Sep 30 10:05:19 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Sep 30 10:05:19 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/igfs/IgfsPath.java | 2 +-
.../internal/processors/igfs/IgfsFileInfo.java | 2 +-
.../internal/processors/igfs/IgfsImpl.java | 57 +----
.../processors/igfs/IgfsMetaManager.java | 251 +++++++++++++++----
.../ignite/igfs/IgfsFragmentizerSelfTest.java | 2 +-
.../processors/igfs/IgfsAbstractSelfTest.java | 80 ++++--
.../igfs/IgfsMetaManagerSelfTest.java | 6 -
.../processors/igfs/IgfsMetricsSelfTest.java | 2 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 29 +--
.../igfs/UniversalFileSystemAdapter.java | 1 -
.../processors/hadoop/igfs/HadoopIgfsUtils.java | 36 +++
...oopFileSystemUniversalFileSystemAdapter.java | 4 +-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 7 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 5 +-
14 files changed, 345 insertions(+), 139 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
index a99c1ee..fb0621c 100644
--- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
+++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPath.java
@@ -50,7 +50,7 @@ public final class IgfsPath implements Comparable<IgfsPath>, Externalizable {
private static final char SLASH_CHAR = '/';
/** The directory separator. */
- private static final String SLASH = "/";
+ public static final String SLASH = "/";
/** URI representing this path. Should never change after object creation or de-serialization. */
private String path;
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
index 116d585..8564500 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileInfo.java
@@ -216,7 +216,7 @@ public final class IgfsFileInfo implements Externalizable {
* @param listing New directory listing.
* @param old Old file info.
*/
- IgfsFileInfo(Map<String, IgfsListingEntry> listing, IgfsFileInfo old) {
+ IgfsFileInfo(@Nullable Map<String, IgfsListingEntry> listing, IgfsFileInfo old) {
this(old.isDirectory(), old.id, old.blockSize, old.len, old.affKey, listing, old.props, old.fileMap(),
old.lockId, false, old.accessTime, old.modificationTime, old.evictExclude());
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index 0dd0307..d5ba95f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -53,7 +53,6 @@ import org.apache.ignite.events.DiscoveryEvent;
import org.apache.ignite.events.Event;
import org.apache.ignite.events.IgfsEvent;
import org.apache.ignite.igfs.IgfsBlockLocation;
-import org.apache.ignite.igfs.IgfsDirectoryNotEmptyException;
import org.apache.ignite.igfs.IgfsFile;
import org.apache.ignite.igfs.IgfsInvalidPathException;
import org.apache.ignite.igfs.IgfsMetrics;
@@ -712,6 +711,9 @@ public final class IgfsImpl implements IgfsEx {
if (log.isDebugEnabled())
log.debug("Deleting file [path=" + path + ", recursive=" + recursive + ']');
+ if (IgfsPath.SLASH.equals(path.toString()))
+ return false;
+
IgfsMode mode = resolveMode(path);
Set<IgfsMode> childrenModes = modeRslvr.resolveChildrenModes(path);
@@ -721,8 +723,11 @@ public final class IgfsImpl implements IgfsEx {
FileDescriptor desc = getFileDescriptor(path);
if (childrenModes.contains(PRIMARY)) {
- if (desc != null)
- res = delete0(desc, path.parent(), recursive);
+ if (desc != null) {
+ IgniteUuid deletedId = meta.softDelete(path, recursive);
+
+ res = deletedId != null;
+ }
else if (mode == PRIMARY)
checkConflictWithPrimary(path);
}
@@ -750,48 +755,6 @@ public final class IgfsImpl implements IgfsEx {
});
}
- /**
- * Internal procedure for (optionally) recursive file and directory deletion.
- *
- * @param desc File descriptor of file or directory to delete.
- * @param parentPath Parent path. If specified, events will be fired for each deleted file
- * or directory. If not specified, events will not be fired.
- * @param recursive Recursive deletion flag.
- * @return {@code True} if file was successfully deleted. If directory is not empty and
- * {@code recursive} flag is false, will return {@code false}.
- * @throws IgniteCheckedException In case of error.
- */
- private boolean delete0(FileDescriptor desc, @Nullable IgfsPath parentPath, boolean recursive)
- throws IgniteCheckedException {
- IgfsPath curPath = parentPath == null ? new IgfsPath() : new IgfsPath(parentPath, desc.fileName);
-
- if (desc.isFile) {
- deleteFile(curPath, desc, true);
-
- return true;
- }
- else {
- if (recursive) {
- meta.softDelete(desc.parentId, desc.fileName, desc.fileId);
-
- return true;
- }
- else {
- Map<String, IgfsListingEntry> infoMap = meta.directoryListing(desc.fileId);
-
- if (F.isEmpty(infoMap)) {
- deleteFile(curPath, desc, true);
-
- return true;
- }
- else
- // Throw exception if not empty and not recursive.
- throw new IgfsDirectoryNotEmptyException("Failed to remove directory (directory is not empty " +
- "and recursive flag is not set)");
- }
- }
- }
-
/** {@inheritDoc} */
@Override public void mkdirs(IgfsPath path) {
mkdirs(path, null);
@@ -1454,7 +1417,7 @@ public final class IgfsImpl implements IgfsEx {
*/
IgniteInternalFuture<?> formatAsync() {
try {
- IgniteUuid id = meta.softDelete(null, null, ROOT_ID);
+ IgniteUuid id = meta.format();
if (id == null)
return new GridFinishedFuture<Object>();
@@ -1526,6 +1489,8 @@ public final class IgfsImpl implements IgfsEx {
* @throws IgniteCheckedException If failed.
*/
@Nullable private FileDescriptor getFileDescriptor(IgfsPath path) throws IgniteCheckedException {
+ assert path != null;
+
List<IgniteUuid> ids = meta.fileIds(path);
IgfsFileInfo fileInfo = meta.info(ids.get(ids.size() - 1));
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
index d283b64..bb6404c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java
@@ -34,6 +34,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.CountDownLatch;
@@ -95,6 +96,20 @@ import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_REA
*/
@SuppressWarnings("all")
public class IgfsMetaManager extends IgfsManager {
+ /** Comparator for Id sorting. */
+ private static final Comparator<IgniteUuid> PATH_ID_SORTING_COMPARATOR
+ = new Comparator<IgniteUuid>() {
+ @Override public int compare(IgniteUuid u1, IgniteUuid u2) {
+ if (u1 == u2)
+ return 0;
+
+ if (u1 == null)
+ return -1;
+
+ return u1.compareTo(u2);
+ }
+ };
+
/** IGFS configuration. */
private FileSystemConfiguration cfg;
@@ -376,6 +391,7 @@ public class IgfsMetaManager extends IgfsManager {
/**
* Gets file info by its ID.
+ * NB: this method is used both in Tx and out of Tx.
*
* @param fileId File ID to get details for.
* @return File info.
@@ -593,12 +609,39 @@ public class IgfsMetaManager extends IgfsManager {
}
/**
+ * Answers if the collection is sorted.
+ *
+ * @param col The collection to check.
+ * @param <T> The type of the collection elements.
+ * @return If the collection sorted.
+ */
+ private static <T extends Comparable<T>> boolean isSorted(Collection<T> col) {
+ T prev = null;
+
+ for (T t: col) {
+ if (t == null)
+ throw new NullPointerException("Collections should not contain nulls");
+
+ if (prev != null && prev.compareTo(t) > 0)
+ return false; // disordered.
+
+ prev = t;
+ }
+
+ return true;
+ }
+
+ /**
* Lock file IDs.
+ *
* @param fileIds File IDs (sorted).
* @return Map with lock info.
* @throws IgniteCheckedException If failed.
*/
private Map<IgniteUuid, IgfsFileInfo> lockIds(Collection<IgniteUuid> fileIds) throws IgniteCheckedException {
+ assert isSorted(fileIds);
+ assert validTxState(true);
+
if (log.isDebugEnabled())
log.debug("Locking file ids: " + fileIds);
@@ -608,19 +651,34 @@ public class IgfsMetaManager extends IgfsManager {
if (log.isDebugEnabled())
log.debug("Locked file ids: " + fileIds);
- // Force root ID always exist in cache.
- if (fileIds.contains(ROOT_ID) && !map.containsKey(ROOT_ID)) {
- IgfsFileInfo info = new IgfsFileInfo();
+ // Force root & trash IDs always exist in cache.
+ addInfoIfNeeded(fileIds, map, ROOT_ID);
+ addInfoIfNeeded(fileIds, map, TRASH_ID);
- id2InfoPrj.putIfAbsent(ROOT_ID, info);
+ // Returns detail's map for locked IDs.
+ return map;
+ }
- map = new GridLeanMap<>(map);
+ /**
+ * Adds FileInfo into the cache if it is requested in fileIds and is not present in the map.
+ *
+ * @param fileIds A list that may contain the id.
+ * @param map The map that may not contain the id.
+ * @param id The id to check.
+ * @throws IgniteCheckedException On error.
+ */
+ private void addInfoIfNeeded(Collection<IgniteUuid> fileIds, Map<IgniteUuid, IgfsFileInfo> map, IgniteUuid id) throws IgniteCheckedException {
+ assert validTxState(true);
- map.put(ROOT_ID, info);
- }
+ if (fileIds.contains(id) && !map.containsKey(id)) {
+ IgfsFileInfo info = new IgfsFileInfo(id);
- // Returns detail's map for locked IDs.
- return map;
+ assert info.listing() != null;
+
+ id2InfoPrj.putIfAbsent(id, info);
+
+ map.put(id, info);
+ }
}
/**
@@ -779,13 +837,11 @@ public class IgfsMetaManager extends IgfsManager {
log.debug("Locking parent id [parentId=" + parentId + ", fileName=" + fileName + ", newFileInfo=" +
newFileInfo + ']');
- validTxState(true);
+ assert validTxState(true);
// Lock only parent file ID.
IgfsFileInfo parentInfo = info(parentId);
- assert validTxState(true);
-
if (parentInfo == null)
throw fsException(new IgfsPathNotFoundException("Failed to lock parent directory (not found): " + parentId));
@@ -798,8 +854,6 @@ public class IgfsMetaManager extends IgfsManager {
IgfsListingEntry entry = parentListing.get(fileName);
- assert validTxState(true);
-
if (entry != null)
return entry.fileId();
@@ -832,18 +886,7 @@ public class IgfsMetaManager extends IgfsManager {
List<IgniteUuid> srcPathIds = fileIds(srcPath);
List<IgniteUuid> dstPathIds = fileIds(dstPath);
- final Set<IgniteUuid> allIds = new TreeSet<>(new Comparator<IgniteUuid>() {
- @Override
- public int compare(IgniteUuid u1, IgniteUuid u2) {
- if (u1 == u2)
- return 0;
-
- if (u1 == null)
- return -1;
-
- return u1.compareTo(u2);
- }
- });
+ final Set<IgniteUuid> allIds = new TreeSet<>(PATH_ID_SORTING_COMPARATOR);
allIds.addAll(srcPathIds);
@@ -1009,6 +1052,7 @@ public class IgfsMetaManager extends IgfsManager {
private void moveNonTx(IgniteUuid fileId, @Nullable String srcFileName, IgniteUuid srcParentId, String destFileName,
IgniteUuid destParentId) throws IgniteCheckedException {
assert validTxState(true);
+
assert fileId != null;
assert srcFileName != null;
assert srcParentId != null;
@@ -1026,8 +1070,6 @@ public class IgfsMetaManager extends IgfsManager {
// Lock file ID and parent IDs for this transaction.
Map<IgniteUuid, IgfsFileInfo> infoMap = lockIds(srcParentId, fileId, destParentId);
- validTxState(true);
-
IgfsFileInfo srcInfo = infoMap.get(srcParentId);
if (srcInfo == null)
@@ -1196,6 +1238,66 @@ public class IgfsMetaManager extends IgfsManager {
}
/**
+ * Deletes (moves to TRASH) all elements under the root folder.
+ *
+ * @return The new Id if the artificially created folder containing all former root
+ * elements moved to TRASH folder.
+ * @throws IgniteCheckedException On error.
+ */
+ IgniteUuid format() throws IgniteCheckedException {
+ if (busyLock.enterBusy()) {
+ try {
+ assert validTxState(false);
+
+ final IgniteInternalTx tx = metaCache.txStartEx(PESSIMISTIC, REPEATABLE_READ);
+
+ try {
+ // NB: We may lock root because its id is less than any other id:
+ final IgfsFileInfo rootInfo = lockIds(ROOT_ID, TRASH_ID).get(ROOT_ID);
+
+ assert rootInfo != null;
+
+ Map<String, IgfsListingEntry> rootListingMap = rootInfo.listing();
+
+ assert rootListingMap != null;
+
+ if (rootListingMap.isEmpty())
+ return null; // Root is empty, nothing to do.
+
+ // Construct new info and move locked entries from root to it.
+ Map<String, IgfsListingEntry> transferListing = new HashMap<>(rootListingMap);
+
+ IgfsFileInfo newInfo = new IgfsFileInfo(transferListing);
+
+ id2InfoPrj.put(newInfo.id(), newInfo);
+
+ // Add new info to trash listing.
+ id2InfoPrj.invoke(TRASH_ID, new UpdateListing(newInfo.id().toString(),
+ new IgfsListingEntry(newInfo), false));
+
+ // Remove listing entries from root.
+ // Note that root directory properties and other attributes are preserved:
+ id2InfoPrj.put(ROOT_ID, new IgfsFileInfo(null/*listing*/, rootInfo));
+
+ tx.commit();
+
+ delWorker.signal();
+
+ return newInfo.id();
+ }
+ finally {
+ tx.close();
+ }
+ }
+ finally {
+ busyLock.leaveBusy();
+ }
+ }
+ else
+ throw new IllegalStateException("Failed to perform format because Grid is stopping.");
+ }
+
+ /**
* Move path to the trash directory.
*
* @param parentId Parent ID.
@@ -1204,26 +1306,86 @@ public class IgfsMetaManager extends IgfsManager {
* @return ID of an entry located directly under the trash directory.
* @throws IgniteCheckedException If failed.
*/
- IgniteUuid softDelete(@Nullable IgniteUuid parentId, @Nullable String pathName, IgniteUuid pathId) throws IgniteCheckedException {
+ IgniteUuid softDelete(final IgfsPath path, final boolean recursive) throws IgniteCheckedException {
if (busyLock.enterBusy()) {
try {
assert validTxState(false);
- IgniteInternalTx tx = metaCache.txStartEx(PESSIMISTIC, REPEATABLE_READ);
+ final SortedSet<IgniteUuid> allIds = new TreeSet<>(PATH_ID_SORTING_COMPARATOR);
+
+ List<IgniteUuid> pathIdList = fileIds(path);
+
+ assert pathIdList.size() > 1;
+
+ final IgniteUuid victimId = pathIdList.get(pathIdList.size() - 1);
+
+ assert !TRASH_ID.equals(victimId) : "TRASH does not have path, it cannot ever be deletion victim.";
+ assert !ROOT_ID.equals(victimId); // root deletion is prevented in earlier stages.
+
+ allIds.addAll(pathIdList);
+
+ if (allIds.remove(null))
+ return null; // A fragment of the path no longer exists.
+
+ boolean added = allIds.add(TRASH_ID);
+ assert added;
+
+ final IgniteInternalTx tx = metaCache.txStartEx(PESSIMISTIC, REPEATABLE_READ);
try {
- if (parentId == null)
- lockIds(pathId, TRASH_ID);
- else
- lockIds(parentId, pathId, TRASH_ID);
+ final Map<IgniteUuid, IgfsFileInfo> infoMap = lockIds(allIds);
+
+ // Directory starure was changed concurrently, so the original path no longer exists:
+ if (!verifyPathIntegrity(path, pathIdList, infoMap))
+ return null;
+
+ final IgfsFileInfo victimInfo = infoMap.get(victimId);
+
+ if (!recursive && victimInfo.isDirectory() && !victimInfo.listing().isEmpty())
+ // Throw exception if not empty and not recursive.
+ throw new IgfsDirectoryNotEmptyException("Failed to remove directory (directory is not " +
+ "empty and recursive flag is not set).");
+
+ IgfsFileInfo destInfo = infoMap.get(TRASH_ID);
- IgniteUuid resId = softDeleteNonTx(parentId, pathName, pathId);
+ assert destInfo != null;
+
+ final String srcFileName = path.name();
+
+ final String destFileName = victimId.toString();
+
+ assert destInfo.listing().get(destFileName) == null : "Failed to add file name into the " +
+ "destination directory (file already exists) [destName=" + destFileName + ']';
+
+ IgfsFileInfo srcParentInfo = infoMap.get(pathIdList.get(pathIdList.size() - 2));
+
+ assert srcParentInfo != null;
+
+ IgniteUuid srcParentId = srcParentInfo.id();
+ assert srcParentId.equals(pathIdList.get(pathIdList.size() - 2));
+
+ IgfsListingEntry srcEntry = srcParentInfo.listing().get(srcFileName);
+
+ assert srcEntry != null : "Deletion victim not found in parent listing [path=" + path +
+ ", name=" + srcFileName + ", listing=" + srcParentInfo.listing() + ']';
+
+ assert victimId.equals(srcEntry.fileId());
+
+ id2InfoPrj.invoke(srcParentId, new UpdateListing(srcFileName, srcEntry, true));
+
+ // Add listing entry into the destination parent listing.
+ id2InfoPrj.invoke(TRASH_ID, new UpdateListing(destFileName, srcEntry, false));
+
+ if (victimInfo.isFile())
+ // Update a file info of the removed file with a file path,
+ // which will be used by delete worker for event notifications.
+ id2InfoPrj.invoke(victimId, new UpdatePath(path));
tx.commit();
delWorker.signal();
- return resId;
+ return victimId;
}
finally {
tx.close();
@@ -1234,8 +1396,8 @@ public class IgfsMetaManager extends IgfsManager {
}
}
else
- throw new IllegalStateException("Failed to perform soft delete because Grid is stopping [parentId=" +
- parentId + ", pathName=" + pathName + ", pathId=" + pathId + ']');
+ throw new IllegalStateException("Failed to perform soft delete because Grid is " +
+ "stopping [path=" + path + ']');
}
/**
@@ -1316,6 +1478,7 @@ public class IgfsMetaManager extends IgfsManager {
/**
* Remove listing entries of the given parent.
+ * This operation actually deletes directories from TRASH, is used solely by IgfsDeleteWorker.
*
* @param parentId Parent ID.
* @param listing Listing entries.
@@ -1403,6 +1566,7 @@ public class IgfsMetaManager extends IgfsManager {
/**
* Remove entry from the metadata listing.
+ * Used solely by IgfsDeleteWorker.
*
* @param parentId Parent ID.
* @param name Name.
@@ -2394,17 +2558,18 @@ public class IgfsMetaManager extends IgfsManager {
if (busyLock.enterBusy()) {
try {
SynchronizationTask<IgfsFileInfo> task = new SynchronizationTask<IgfsFileInfo>() {
- @Override public IgfsFileInfo onSuccess(Map<IgfsPath, IgfsFileInfo> infos)
- throws Exception {
+ @Override public IgfsFileInfo onSuccess(Map<IgfsPath, IgfsFileInfo> infos) throws Exception {
if (infos.get(path) == null)
return null;
fs.update(path, props);
- assert path.parent() == null || infos.get(path.parent()) != null;
+ IgfsFileInfo parentInfo = infos.get(path.parent());
+
+ assert path.parent() == null || parentInfo != null;
- return updatePropertiesNonTx(infos.get(path.parent()).id(), infos.get(path).id(), path.name(),
- props);
+ return updatePropertiesNonTx(parentInfo == null ? null : parentInfo.id(),
+ infos.get(path).id(), path.name(), props);
}
@Override public IgfsFileInfo onFailure(@Nullable Exception err) throws IgniteCheckedException {
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
index ebf91e0..fd4ec17 100644
--- a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerSelfTest.java
@@ -237,7 +237,7 @@ public class IgfsFragmentizerSelfTest extends IgfsFragmentizerAbstractSelfTest {
U.sleep(200);
}
- igfs.delete(new IgfsPath("/"), true);
+ igfs.format();
igfs.awaitDeletesAsync().get();
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
index cfa99ff..7e73859 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java
@@ -101,10 +101,10 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
protected static final long BLOCK_SIZE = 32 * 1024 * 1024;
/** Default repeat count. */
- protected static final int REPEAT_CNT = 5;
+ protected static final int REPEAT_CNT = 5; // Diagnostic: ~100; Regression: 5
/** Concurrent operations count. */
- protected static final int OPS_CNT = 16;
+ protected static final int OPS_CNT = 16; // Diagnostic: ~160; Regression: 16
/** Seed. */
protected static final long SEED = System.currentTimeMillis();
@@ -252,6 +252,8 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
clear(igfs, igfsSecondary);
+
+ assert igfs.listFiles(new IgfsPath("/")).isEmpty();
}
/** {@inheritDoc} */
@@ -923,6 +925,23 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
}
/**
+ * Tests that root directory properties persist afetr the #format() operation.
+ *
+ * @throws Exception If failed.
+ */
+ public void testRootPropertiesPersistAfterFormat() throws Exception {
+ igfs.update(new IgfsPath("/"), Collections.singletonMap("foo", "moo"));
+
+ igfs.format();
+
+ IgfsFile file = igfs.info(new IgfsPath("/"));
+
+ Map<String,String> props = file.properties();
+
+ assertEquals("moo", props.get("foo"));
+ }
+
+ /**
* Test regular file open.
*
* @throws Exception If failed.
@@ -1600,6 +1619,8 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
* @throws Exception If failed.
*/
public void testConcurrentMkdirsDelete() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1541");
+
for (int i = 0; i < REPEAT_CNT; i++) {
final CyclicBarrier barrier = new CyclicBarrier(2);
@@ -1881,18 +1902,10 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
public void testDeadlocksRename() throws Exception {
for (int i = 0; i < REPEAT_CNT; i++) {
try {
- info(">>>>>> Start deadlock test.");
-
checkDeadlocks(5, 2, 2, 2, OPS_CNT, 0, 0, 0, 0);
-
- info(">>>>>> End deadlock test.");
}
finally {
- info(">>>>>> Start cleanup.");
-
clear(igfs, igfsSecondary);
-
- info(">>>>>> End cleanup.");
}
}
}
@@ -1903,8 +1916,6 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
* @throws Exception If failed.
*/
public void testDeadlocksDelete() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-1515");
-
for (int i = 0; i < REPEAT_CNT; i++) {
try {
checkDeadlocks(5, 2, 2, 2, 0, OPS_CNT, 0, 0, 0);
@@ -1948,6 +1959,42 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
}
/**
+ * Ensure that deadlocks do not occur during concurrent delete & rename operations.
+ *
+ * @throws Exception If failed.
+ */
+ public void testDeadlocksDeleteRename() throws Exception {
+ for (int i = 0; i < REPEAT_CNT; i++) {
+ try {
+ checkDeadlocks(5, 2, 2, 2,
+ OPS_CNT, OPS_CNT, 0, 0, 0);
+ }
+ finally {
+ clear(igfs, igfsSecondary);
+ }
+ }
+ }
+
+ /**
+ * Ensure that deadlocks do not occur during concurrent delete & rename operations.
+ *
+ * @throws Exception If failed.
+ */
+ public void testDeadlocksDeleteMkdirs() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1541");
+
+ for (int i = 0; i < REPEAT_CNT; i++) {
+ try {
+ checkDeadlocks(5, 2, 2, 2,
+ 0, OPS_CNT, 0, OPS_CNT, 0);
+ }
+ finally {
+ clear(igfs, igfsSecondary);
+ }
+ }
+ }
+
+ /**
* Ensure that deadlocks do not occur during concurrent file creation operations.
*
* @throws Exception If failed.
@@ -1969,11 +2016,16 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest {
* @throws Exception If failed.
*/
public void testDeadlocks() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-1515");
+ fail("https://issues.apache.org/jira/browse/IGNITE-1541");
for (int i = 0; i < REPEAT_CNT; i++) {
try {
- checkDeadlocks(5, 2, 2, 2, OPS_CNT, OPS_CNT, OPS_CNT, OPS_CNT, OPS_CNT);
+ checkDeadlocks(5, 2, 2, 2,
+ OPS_CNT, // rename
+ OPS_CNT, // delete
+ OPS_CNT, // update
+ OPS_CNT, // mkdirs
+ OPS_CNT); // create
}
finally {
clear(igfs, igfsSecondary);
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
index 206c9fe..4072636 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java
@@ -300,25 +300,19 @@ public class IgfsMetaManagerSelfTest extends IgfsCommonAbstractTest {
System.out.println("b: " + mgr.directoryListing(b.id()));
System.out.println("f3: " + mgr.directoryListing(f3.id()));
- //mgr.move(a.id(), "a", ROOT_ID, "a2", ROOT_ID);
mgr.move(path("/a"), path("/a2"));
- //mgr.move(b.id(), "b", a.id(), "b2", a.id());
mgr.move(path("/a2/b"), path("/a2/b2"));
assertNotNull(mgr.info(b.id()));
- //mgr.move(f3.id(), "f3", b.id(), "f3-2", a.id());
mgr.move(path("/a2/b2/f3"), path("/a2/b2/f3-2"));
assertNotNull(mgr.info(b.id()));
- //mgr.move(f3.id(), "f3-2", a.id(), "f3", b.id());
mgr.move(path("/a2/b2/f3-2"), path("/a2/b2/f3"));
- //mgr.move(b.id(), "b2", a.id(), "b", a.id());
mgr.move(path("/a2/b2"), path("/a2/b"));
- //mgr.move(a.id(), "a2", ROOT_ID, "a", ROOT_ID);
mgr.move(path("/a2"), path("/a"));
// Validate 'remove' operation.
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
index 8a2e5bf..fb1d6f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetricsSelfTest.java
@@ -348,7 +348,7 @@ public class IgfsMetricsSelfTest extends IgfsCommonAbstractTest {
assertEquals(0, m.filesOpenedForRead());
assertEquals(0, m.filesOpenedForWrite());
- fs.delete(new IgfsPath("/"), true);
+ fs.format();
m = fs.metrics();
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
index cb134f8..9c4d832 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java
@@ -389,15 +389,6 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
assert paths.size() == 3 : "Unexpected paths: " + paths;
- // Delete.
- GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
- @Override public Object call() throws Exception {
- igfs.delete(path("/"), false);
-
- return null;
- }
- }, IgfsException.class, null);
-
igfs.delete(path("/A1/B1/C1"), false);
assertNull(igfs.info(path("/A1/B1/C1")));
@@ -416,19 +407,19 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
assertEquals(Arrays.asList(path("/A"), path("/A1"), path("/A2")), sorted(igfs.listPaths(path("/"))));
- GridTestUtils.assertThrowsInherited(log, new Callable<Object>() {
- @Override public Object call() throws Exception {
- igfs.delete(path("/"), false);
-
- return null;
- }
- }, IgfsException.class, null);
- assertEquals(Arrays.asList(path("/A"), path("/A1"), path("/A2")), sorted(igfs.listPaths(path("/"))));
-
+ // Delete root when it is not empty:
igfs.delete(path("/"), true);
+ igfs.delete(path("/"), false);
+
+ igfs.delete(path("/A"), true);
+ igfs.delete(path("/A1"), true);
+ igfs.delete(path("/A2"), true);
assertEquals(Collections.<IgfsPath>emptyList(), igfs.listPaths(path("/")));
+ // Delete root when it is empty:
igfs.delete(path("/"), false);
+ igfs.delete(path("/"), true);
+
assertEquals(Collections.<IgfsPath>emptyList(), igfs.listPaths(path("/")));
for (Cache.Entry<Object, Object> e : metaCache)
@@ -608,7 +599,7 @@ public class IgfsProcessorSelfTest extends IgfsCommonAbstractTest {
assertEquals(text, read("/b"));
// Cleanup.
- igfs.delete(root, true);
+ igfs.format();
assertEquals(Collections.<IgfsPath>emptyList(), igfs.listPaths(root));
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
index 3bf70e2..ba8c164 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/UniversalFileSystemAdapter.java
@@ -28,7 +28,6 @@ import java.util.Map;
* To be used solely in tests.
*/
public interface UniversalFileSystemAdapter {
-
/**
* Gets name of the FS.
* @return name of this file system.
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java
index 3913cbd..fa5cbc5 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java
@@ -20,7 +20,11 @@ package org.apache.ignite.internal.processors.hadoop.igfs;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.AbstractFileSystem;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.ParentNotDirectoryException;
+import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathExistsException;
import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
import org.apache.ignite.IgniteCheckedException;
@@ -130,6 +134,38 @@ public class HadoopIgfsUtils {
}
/**
+ * Deletes all files from the given file system.
+ *
+ * @param fs The file system to clean up.
+ * @throws IOException On error.
+ */
+ public static void clear(FileSystem fs) throws IOException {
+ // Delete root contents:
+ FileStatus[] statuses = fs.listStatus(new Path("/"));
+
+ if (statuses != null) {
+ for (FileStatus stat: statuses)
+ fs.delete(stat.getPath(), true);
+ }
+ }
+
+ /**
+ * Deletes all files from the given file system.
+ *
+ * @param fs The file system to clean up.
+ * @throws IOException On error.
+ */
+ public static void clear(AbstractFileSystem fs) throws IOException {
+ // Delete root contents:
+ FileStatus[] statuses = fs.listStatus(new Path("/"));
+
+ if (statuses != null) {
+ for (FileStatus stat: statuses)
+ fs.delete(stat.getPath(), true);
+ }
+ }
+
+ /**
* Constructor.
*/
private HadoopIgfsUtils() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
index 03f0066..608bd25 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopFileSystemUniversalFileSystemAdapter.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsUtils;
import org.apache.ignite.internal.processors.igfs.IgfsEx;
import org.apache.ignite.internal.processors.igfs.UniversalFileSystemAdapter;
@@ -33,7 +34,6 @@ import org.apache.ignite.internal.processors.igfs.UniversalFileSystemAdapter;
* Universal adapter wrapping {@link org.apache.hadoop.fs.FileSystem} instance.
*/
public class HadoopFileSystemUniversalFileSystemAdapter implements UniversalFileSystemAdapter {
-
/** The wrapped filesystem. */
private final FileSystem fileSys;
@@ -70,7 +70,7 @@ public class HadoopFileSystemUniversalFileSystemAdapter implements UniversalFile
/** {@inheritDoc} */
@Override public void format() throws IOException {
- fileSys.delete(new Path("/"), true);
+ HadoopIgfsUtils.clear(fileSys);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
index 1235786..c938571 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/HadoopIgfs20FileSystemAbstractSelfTest.java
@@ -59,6 +59,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.FileSystemConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
+import org.apache.ignite.internal.processors.hadoop.igfs.HadoopIgfsUtils;
import org.apache.ignite.internal.processors.igfs.IgfsCommonAbstractTest;
import org.apache.ignite.internal.util.GridConcurrentHashSet;
import org.apache.ignite.internal.util.typedef.F;
@@ -352,7 +353,7 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
try {
- fs.delete(new Path("/"), true);
+ HadoopIgfsUtils.clear(fs);
}
catch (Exception ignore) {
// No-op.
@@ -627,7 +628,9 @@ public abstract class HadoopIgfs20FileSystemAbstractSelfTest extends IgfsCommonA
Path root = new Path(fsHome, "/");
- assertTrue(fs.delete(root, true));
+ assertFalse(fs.delete(root, true));
+
+ assertTrue(fs.delete(new Path(fsHome, "/someDir1"), true));
assertPathDoesNotExist(fs, someDir3);
assertPathDoesNotExist(fs, new Path(fsHome, "/someDir1/someDir2"));
http://git-wip-us.apache.org/repos/asf/ignite/blob/54bb7d76/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
index 5ea841e..2626ebb 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java
@@ -300,7 +300,7 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
try {
- fs.delete(new Path("/"), true);
+ HadoopIgfsUtils.clear(fs);
}
catch (Exception ignore) {
// No-op.
@@ -783,7 +783,8 @@ public abstract class IgniteHadoopFileSystemAbstractSelfTest extends IgfsCommonA
Path root = new Path(fsHome, "/");
- assertTrue(fs.delete(root, true));
+ assertFalse(fs.delete(root, true));
+ assertTrue(fs.delete(new Path("/someDir1"), true));
assertPathDoesNotExist(fs, someDir3);
assertPathDoesNotExist(fs, new Path(fsHome, "/someDir1/someDir2"));
[4/7] ignite git commit: More info in assert.
Posted by sb...@apache.org.
More info in assert.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/be906e32
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/be906e32
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/be906e32
Branch: refs/heads/ignite-1534
Commit: be906e32f68d35e01f0b0e5f610937a27277f71a
Parents: bfabab2
Author: sboikov <sb...@gridgain.com>
Authored: Wed Sep 30 09:29:38 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Sep 30 09:29:38 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/util/nio/GridNioRecoveryDescriptor.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/be906e32/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java
index 42656c4..88837de 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioRecoveryDescriptor.java
@@ -259,8 +259,8 @@ public class GridNioRecoveryDescriptor {
*/
public void connected() {
synchronized (this) {
- assert reserved;
- assert !connected;
+ assert reserved : this;
+ assert !connected : this;
connected = true;
[2/7] ignite git commit: IGNITE-1552 - Fixed parsing for SQL table
function
Posted by sb...@apache.org.
IGNITE-1552 - Fixed parsing for SQL table function
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/74029187
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/74029187
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/74029187
Branch: refs/heads/ignite-1534
Commit: 740291871013bef818edf3faf19c8d4c6eab1ba5
Parents: c2cedb0
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Sep 29 17:04:52 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Tue Sep 29 17:04:52 2015 -0700
----------------------------------------------------------------------
.../processors/query/h2/sql/GridSqlArray.java | 52 ++++++++++++
.../processors/query/h2/sql/GridSqlElement.java | 2 +-
.../query/h2/sql/GridSqlFunction.java | 60 ++++++++------
.../query/h2/sql/GridSqlFunctionType.java | 3 +
.../query/h2/sql/GridSqlPlaceholder.java | 7 +-
.../query/h2/sql/GridSqlQueryParser.java | 84 ++++++++++++--------
.../processors/query/h2/sql/GridSqlType.java | 29 ++++++-
.../query/h2/sql/GridQueryParsingTest.java | 27 +++++++
8 files changed, 199 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlArray.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlArray.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlArray.java
new file mode 100644
index 0000000..69e98bf
--- /dev/null
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlArray.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.h2.sql;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import org.h2.util.StatementBuilder;
+
+/**
+ * SQL Array: (1, 2, ?, 'abc')
+ */
+public class GridSqlArray extends GridSqlElement {
+ /**
+ * @param size Array size.
+ */
+ public GridSqlArray(int size) {
+ super(size == 0 ? Collections.<GridSqlElement>emptyList() : new ArrayList<GridSqlElement>(size));
+ }
+
+ /** {@inheritDoc} */
+ @Override public String getSQL() {
+ if (size() == 0)
+ return "()";
+
+ StatementBuilder buff = new StatementBuilder("(");
+
+ for (GridSqlElement e : children) {
+ buff.appendExceptFirst(", ");
+ buff.append(e.getSQL());
+ }
+
+ if (size() == 1)
+ buff.append(',');
+
+ return buff.append(')').toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
index 41b7ba4..57d3c57 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
@@ -25,7 +25,7 @@ import java.util.List;
*/
public abstract class GridSqlElement implements Iterable<GridSqlElement> {
/** */
- protected List<GridSqlElement> children;
+ protected final List<GridSqlElement> children;
/** */
private GridSqlType resultType;
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
index 51433c0..7cd7a6b 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
@@ -27,7 +27,6 @@ import org.h2.value.ValueString;
import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlFunctionType.CASE;
import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlFunctionType.CAST;
-import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlFunctionType.CONVERT;
import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlFunctionType.UNKNOWN_FUNCTION;
/**
@@ -70,7 +69,7 @@ public class GridSqlFunction extends GridSqlElement {
super(new ArrayList<GridSqlElement>());
if (name == null)
- throw new NullPointerException();
+ throw new NullPointerException("name");
if (type == null)
type = UNKNOWN_FUNCTION;
@@ -113,31 +112,46 @@ public class GridSqlFunction extends GridSqlElement {
buff.append('(');
- if (type == CAST) {
- String castType = resultType().sql();
+ switch (type) {
+ case CAST:
+ case CONVERT:
+ assert size() == 1;
- assert !F.isEmpty(castType) : castType;
- assert size() == 1;
+ String castType = resultType().sql();
- buff.append(child().getSQL()).append(" AS ").append(castType);
- }
- else if (type == CONVERT) {
- String castType = resultType().sql();
+ assert !F.isEmpty(castType) : castType;
- assert !F.isEmpty(castType) : castType;
- assert size() == 1;
+ buff.append(child().getSQL());
+ buff.append(type == CAST ? " AS " : ",");
+ buff.append(castType);
- buff.append(child().getSQL()).append(',').append(castType);
- }
- else if (type == GridSqlFunctionType.EXTRACT) {
- ValueString v = (ValueString)((GridSqlConst)child(0)).value();
- buff.append(v.getString()).append(" FROM ").append(child(1).getSQL());
- }
- else {
- for (GridSqlElement e : children) {
- buff.appendExceptFirst(", ");
- buff.append(e.getSQL());
- }
+ break;
+
+ case EXTRACT:
+ ValueString v = (ValueString)((GridSqlConst)child(0)).value();
+ buff.append(v.getString()).append(" FROM ").append(child(1).getSQL());
+
+ break;
+
+ case TABLE:
+ for (GridSqlElement e : children) {
+ buff.appendExceptFirst(", ");
+
+ // id int = ?, name varchar = ('aaa', 'bbb')
+ buff.append(((GridSqlAlias)e).alias())
+ .append(' ')
+ .append(e.resultType().sql())
+ .append('=')
+ .append(e.child().getSQL());
+ }
+
+ break;
+
+ default:
+ for (GridSqlElement e : children) {
+ buff.appendExceptFirst(", ");
+ buff.append(e.getSQL());
+ }
}
return buff.append(')').toString();
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunctionType.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunctionType.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunctionType.java
index 7b78d7a..8e56d33 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunctionType.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunctionType.java
@@ -61,6 +61,9 @@ public enum GridSqlFunctionType {
/** */
SYSTEM_RANGE,
+ /** TABLE and TABLE_DISTINCT */
+ TABLE,
+
/** Constant for all other functions. */
UNKNOWN_FUNCTION;
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlPlaceholder.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlPlaceholder.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlPlaceholder.java
index aa00c69..0bb69a8 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlPlaceholder.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlPlaceholder.java
@@ -44,12 +44,7 @@ public class GridSqlPlaceholder extends GridSqlElement {
}
/** {@inheritDoc} */
- @Override public GridSqlElement addChild(GridSqlElement expr) {
- throw new IllegalStateException();
- }
-
- /** {@inheritDoc} */
- @Override public GridSqlElement child(int idx) {
+ @Override public GridSqlElement resultType(GridSqlType type) {
throw new IllegalStateException();
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
index bffa36e..2789796 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
@@ -19,10 +19,8 @@ package org.apache.ignite.internal.processors.query.h2.sql;
import java.lang.reflect.Field;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.List;
-import java.util.Set;
import org.apache.ignite.IgniteException;
import org.h2.command.Command;
import org.h2.command.Prepared;
@@ -42,11 +40,13 @@ import org.h2.expression.ConditionInSelect;
import org.h2.expression.ConditionNot;
import org.h2.expression.Expression;
import org.h2.expression.ExpressionColumn;
+import org.h2.expression.ExpressionList;
import org.h2.expression.Function;
import org.h2.expression.JavaFunction;
import org.h2.expression.Operation;
import org.h2.expression.Parameter;
import org.h2.expression.Subquery;
+import org.h2.expression.TableFunction;
import org.h2.expression.ValueExpression;
import org.h2.jdbc.JdbcPreparedStatement;
import org.h2.result.SortOrder;
@@ -57,7 +57,6 @@ import org.h2.table.Table;
import org.h2.table.TableBase;
import org.h2.table.TableFilter;
import org.h2.table.TableView;
-import org.h2.value.Value;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlOperationType.AND;
@@ -83,6 +82,8 @@ import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlOperatio
import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlOperationType.SMALLER;
import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlOperationType.SMALLER_EQUAL;
import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlOperationType.SPATIAL_INTERSECTS;
+import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlType.fromColumn;
+import static org.apache.ignite.internal.processors.query.h2.sql.GridSqlType.fromExpression;
/**
* H2 Query parser.
@@ -155,6 +156,9 @@ public class GridSqlQueryParser {
getter(ConditionInConstantSet.class, "valueList");
/** */
+ private static final Getter<ExpressionList, Expression[]> EXPR_LIST = getter(ExpressionList.class, "list");
+
+ /** */
private static final Getter<ConditionInSelect, Expression> LEFT_CIS = getter(ConditionInSelect.class, "left");
/** */
@@ -198,6 +202,9 @@ public class GridSqlQueryParser {
private static final Getter<FunctionTable, Expression> FUNC_EXPR = getter(FunctionTable.class, "functionExpr");
/** */
+ private static final Getter<TableFunction, Column[]> FUNC_TBL_COLS = getter(TableFunction.class, "columnList");
+
+ /** */
private static final Getter<JavaFunction, FunctionAlias> FUNC_ALIAS = getter(JavaFunction.class, "functionAlias");
/** */
@@ -293,8 +300,6 @@ public class GridSqlQueryParser {
Expression where = CONDITION.get(select);
res.where(parseExpression(where, false));
- Set<TableFilter> allFilters = new HashSet<>(select.getTopFilters());
-
GridSqlElement from = null;
TableFilter filter = select.getTopTableFilter();
@@ -308,16 +313,12 @@ public class GridSqlQueryParser {
from = from == null ? gridFilter : new GridSqlJoin(from, gridFilter, filter.isJoinOuter(),
parseExpression(filter.getJoinCondition(), false));
- allFilters.remove(filter);
-
filter = filter.getJoin();
}
while (filter != null);
res.from(from);
- assert allFilters.isEmpty();
-
ArrayList<Expression> expressions = select.getExpressions();
for (int i = 0; i < expressions.size(); i++)
@@ -419,18 +420,8 @@ public class GridSqlQueryParser {
if (res == null) {
res = parseExpression0(expression, calcTypes);
- if (calcTypes) {
- GridSqlType type = GridSqlType.UNKNOWN;
-
- if (expression.getType() != Value.UNKNOWN) {
- Column c = new Column(null, expression.getType(), expression.getPrecision(), expression.getScale(),
- expression.getDisplaySize());
-
- type = new GridSqlType(c.getType(), c.getScale(), c.getPrecision(), c.getDisplaySize(), c.getCreateSQL());
- }
-
- res.resultType(type);
- }
+ if (calcTypes)
+ res.resultType(fromExpression(expression));
h2ObjToGridObj.put(expression, res);
}
@@ -577,24 +568,38 @@ public class GridSqlQueryParser {
GridSqlFunction res = new GridSqlFunction(null, f.getName());
if (f.getArgs() != null) {
- for (Expression arg : f.getArgs()) {
- if (arg == null) {
- if (f.getFunctionType() != Function.CASE)
- throw new IllegalStateException("Function type with null arg: " + f.getFunctionType());
+ if (f.getFunctionType() == Function.TABLE || f.getFunctionType() == Function.TABLE_DISTINCT) {
+ Column[] cols = FUNC_TBL_COLS.get((TableFunction)f);
+ Expression[] args = f.getArgs();
+
+ assert cols.length == args.length;
- res.addChild(GridSqlPlaceholder.EMPTY);
+ for (int i = 0; i < cols.length; i++) {
+ GridSqlElement arg = parseExpression(args[i], calcTypes);
+
+ GridSqlAlias alias = new GridSqlAlias(cols[i].getName(), arg, false);
+
+ alias.resultType(fromColumn(cols[i]));
+
+ res.addChild(alias);
+ }
+ }
+ else {
+ for (Expression arg : f.getArgs()) {
+ if (arg == null) {
+ if (f.getFunctionType() != Function.CASE)
+ throw new IllegalStateException("Function type with null arg: " + f.getFunctionType());
+
+ res.addChild(GridSqlPlaceholder.EMPTY);
+ }
+ else
+ res.addChild(parseExpression(arg, calcTypes));
}
- else
- res.addChild(parseExpression(arg, calcTypes));
}
}
- if (f.getFunctionType() == Function.CAST || f.getFunctionType() == Function.CONVERT) {
- Column c = new Column(null, f.getType(), f.getPrecision(), f.getScale(), f.getDisplaySize());
-
- res.resultType(new GridSqlType(c.getType(), c.getScale(), c.getPrecision(),
- c.getDisplaySize(), c.getCreateSQL()));
- }
+ if (f.getFunctionType() == Function.CAST || f.getFunctionType() == Function.CONVERT)
+ res.resultType(fromExpression(f));
return res;
}
@@ -629,6 +634,17 @@ public class GridSqlQueryParser {
return res;
}
+ if (expression instanceof ExpressionList) {
+ Expression[] exprs = EXPR_LIST.get((ExpressionList)expression);
+
+ GridSqlArray res = new GridSqlArray(exprs.length);
+
+ for (Expression expr : exprs)
+ res.addChild(parseExpression(expr, calcTypes));
+
+ return res;
+ }
+
throw new IgniteException("Unsupported expression: " + expression + " [type=" +
expression.getClass().getSimpleName() + ']');
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlType.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlType.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlType.java
index 6ff3231..febf174 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlType.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlType.java
@@ -17,7 +17,10 @@
package org.apache.ignite.internal.processors.query.h2.sql;
+import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.h2.expression.Expression;
+import org.h2.table.Column;
import org.h2.value.Value;
import org.h2.value.ValueDouble;
import org.h2.value.ValueLong;
@@ -62,7 +65,9 @@ public final class GridSqlType {
* @param displaySize Display size.
* @param sql SQL definition of the type.
*/
- public GridSqlType(int type, int scale, long precision, int displaySize, String sql) {
+ private GridSqlType(int type, int scale, long precision, int displaySize, String sql) {
+ assert !F.isEmpty(sql) || type == Value.UNKNOWN;
+
this.type = type;
this.scale = scale;
this.precision = precision;
@@ -71,6 +76,28 @@ public final class GridSqlType {
}
/**
+ * @param c Column to take type definition from.
+ * @return Type.
+ */
+ public static GridSqlType fromColumn(Column c) {
+ if (c.getName() != null)
+ c = new Column(null, c.getType(), c.getPrecision(), c.getScale(), c.getDisplaySize());
+
+ return new GridSqlType(c.getType(), c.getScale(), c.getPrecision(), c.getDisplaySize(), c.getCreateSQL());
+ }
+
+ /**
+ * @param e Expression to take type from.
+ * @return Type.
+ */
+ public static GridSqlType fromExpression(Expression e) {
+ if (e.getType() == Value.UNKNOWN)
+ return UNKNOWN;
+
+ return fromColumn(new Column(null, e.getType(), e.getPrecision(), e.getScale(), e.getDisplaySize()));
+ }
+
+ /**
* @return Get H2 type.
*/
public int type() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/74029187/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
index f969a48..2be5d1a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
@@ -98,6 +98,33 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testAllExamples() throws Exception {
+ checkQuery("select 42");
+ checkQuery("select ()");
+ checkQuery("select (1)");
+ checkQuery("select (1 + 1)");
+ checkQuery("select (1,)");
+ checkQuery("select (?)");
+ checkQuery("select (?,)");
+ checkQuery("select (1, 2)");
+ checkQuery("select (?, ? + 1, 2 + 2) as z");
+ checkQuery("select (1,(1,(1,(1,(1,?)))))");
+ checkQuery("select (select 1)");
+ checkQuery("select (select 1, select ?)");
+ checkQuery("select ((select 1), select ? + ?)");
+
+ checkQuery("select extract(year from ?)");
+ checkQuery("select convert(?, timestamp)");
+
+ checkQuery("select * from table(id bigint = 1)");
+ checkQuery("select * from table(id bigint = (1))");
+ checkQuery("select * from table(id bigint = (1,))");
+ checkQuery("select * from table(id bigint = (1,), name varchar = 'asd')");
+ checkQuery("select * from table(id bigint = (1,2), name varchar = 'asd')");
+ checkQuery("select * from table(id bigint = (1,2), name varchar = ('asd',))");
+ checkQuery("select * from table(id bigint = (1,2), name varchar = ?)");
+ checkQuery("select * from table(id bigint = (1,2), name varchar = (?,))");
+ checkQuery("select * from table(id bigint = ?, name varchar = ('abc', 'def', 100, ?)) t");
+
checkQuery("select ? limit ? offset ?");
checkQuery("select cool1()");
[6/7] ignite git commit: # master - changed "communication
encryption" to "ssl"
Posted by sb...@apache.org.
# master - changed "communication encryption" to "ssl"
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c6ec7e11
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c6ec7e11
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c6ec7e11
Branch: refs/heads/ignite-1534
Commit: c6ec7e1165017d4331199bdf667b81a6f2ed91c8
Parents: 54bb7d7
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Wed Sep 30 10:52:15 2015 +0200
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Wed Sep 30 10:52:15 2015 +0200
----------------------------------------------------------------------
.../apache/ignite/internal/IgniteKernal.java | 70 ++++++++++----------
1 file changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c6ec7e11/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 60725e4..68a0383 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -17,38 +17,6 @@
package org.apache.ignite.internal;
-import java.io.Externalizable;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InvalidObjectException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-import java.lang.management.ManagementFactory;
-import java.lang.management.RuntimeMXBean;
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Constructor;
-import java.text.DateFormat;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Timer;
-import java.util.UUID;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-import javax.management.JMException;
-import javax.management.ObjectName;
import org.apache.ignite.IgniteAtomicLong;
import org.apache.ignite.IgniteAtomicReference;
import org.apache.ignite.IgniteAtomicSequence;
@@ -64,7 +32,6 @@ import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.IgniteMessaging;
-import org.apache.ignite.internal.portable.api.IgnitePortables;
import org.apache.ignite.IgniteQueue;
import org.apache.ignite.IgniteScheduler;
import org.apache.ignite.IgniteServices;
@@ -94,6 +61,7 @@ import org.apache.ignite.internal.managers.failover.GridFailoverManager;
import org.apache.ignite.internal.managers.indexing.GridIndexingManager;
import org.apache.ignite.internal.managers.loadbalancer.GridLoadBalancerManager;
import org.apache.ignite.internal.managers.swapspace.GridSwapSpaceManager;
+import org.apache.ignite.internal.portable.api.IgnitePortables;
import org.apache.ignite.internal.processors.GridProcessor;
import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor;
import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
@@ -157,7 +125,6 @@ import org.apache.ignite.lifecycle.LifecycleBean;
import org.apache.ignite.lifecycle.LifecycleEventType;
import org.apache.ignite.marshaller.MarshallerExclusions;
import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
-import org.apache.ignite.internal.portable.api.PortableMarshaller;
import org.apache.ignite.mxbean.ClusterLocalNodeMetricsMXBean;
import org.apache.ignite.mxbean.IgniteMXBean;
import org.apache.ignite.mxbean.ThreadPoolMXBean;
@@ -168,6 +135,39 @@ import org.apache.ignite.spi.IgniteSpi;
import org.apache.ignite.spi.IgniteSpiVersionCheckException;
import org.jetbrains.annotations.Nullable;
+import javax.management.JMException;
+import javax.management.ObjectName;
+import java.io.Externalizable;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InvalidObjectException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Constructor;
+import java.text.DateFormat;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
+
import static org.apache.ignite.IgniteSystemProperties.IGNITE_CONFIG_URL;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_DAEMON;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_NO_ASCII;
@@ -2177,7 +2177,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
assert log != null;
U.quietAndInfo(log, "Security status [authentication=" + onOff(ctx.security().enabled())
- + ", communication encryption=" + onOff(ctx.config().getSslContextFactory() != null) + ']');
+ + ", ssl=" + onOff(ctx.config().getSslContextFactory() != null) + ']');
}
/**
[3/7] ignite git commit: Disable shmem in failover tests to avoid
ignite-1578.
Posted by sb...@apache.org.
Disable shmem in failover tests to avoid ignite-1578.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bfabab2d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bfabab2d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bfabab2d
Branch: refs/heads/ignite-1534
Commit: bfabab2d0ee22808eef8a597b4b82dd84e5a2c87
Parents: 7402918
Author: sboikov <sb...@gridgain.com>
Authored: Wed Sep 30 09:19:28 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Sep 30 09:26:21 2015 +0300
----------------------------------------------------------------------
.../GridCacheAbstractFailoverSelfTest.java | 3 ++
.../GridCacheAbstractRemoveFailureTest.java | 3 ++
.../cache/IgniteCacheCreateRestartSelfTest.java | 3 ++
...acheAsyncOperationsFailoverAbstractTest.java | 11 ++++++++
.../CachePutAllFailoverAbstractTest.java | 11 ++++++++
.../IgniteCachePutGetRestartAbstractTest.java | 3 ++
.../IgniteCacheSizeFailoverTest.java | 3 ++
...gniteAtomicLongChangingTopologySelfTest.java | 29 +++++++-------------
.../IgniteCacheCrossCacheTxFailoverTest.java | 3 ++
9 files changed, 50 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
index e55803a..f4813ff 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
@@ -33,6 +33,7 @@ import org.apache.ignite.internal.util.typedef.CIX1;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -86,6 +87,8 @@ public abstract class GridCacheAbstractFailoverSelfTest extends GridCacheAbstrac
discoSpi.setHeartbeatFrequency(30_000);
discoSpi.setReconnectCount(2);
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
return cfg;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
index a3d9948..122910e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.util.lang.GridTuple;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -92,6 +93,8 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCommonAbstr
cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
return cfg;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheCreateRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheCreateRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheCreateRestartSelfTest.java
index 0a2d778..6f32d36 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheCreateRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheCreateRestartSelfTest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.Ignite;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -47,6 +48,8 @@ public class IgniteCacheCreateRestartSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
cfg.setPeerClassLoadingEnabled(false);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAsyncOperationsFailoverAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAsyncOperationsFailoverAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAsyncOperationsFailoverAbstractTest.java
index ecdfaac..25fb8de 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAsyncOperationsFailoverAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheAsyncOperationsFailoverAbstractTest.java
@@ -29,12 +29,14 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteFuture;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.jetbrains.annotations.NotNull;
@@ -51,6 +53,15 @@ public abstract class CacheAsyncOperationsFailoverAbstractTest extends GridCache
private static final long TEST_TIME = 60_000;
/** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return NODE_CNT;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePutAllFailoverAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePutAllFailoverAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePutAllFailoverAbstractTest.java
index f558ba0..86707f6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePutAllFailoverAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CachePutAllFailoverAbstractTest.java
@@ -28,12 +28,14 @@ import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteFuture;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.jetbrains.annotations.NotNull;
@@ -50,6 +52,15 @@ public abstract class CachePutAllFailoverAbstractTest extends GridCacheAbstractS
private static final long TEST_TIME = 60_000;
/** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
@Override protected int gridCount() {
return NODE_CNT;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
index 1d92750..1d4370a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCachePutGetRestartAbstractTest.java
@@ -32,6 +32,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.cache.IgniteCacheAbstractTest;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.transactions.Transaction;
@@ -81,6 +82,8 @@ public abstract class IgniteCachePutGetRestartAbstractTest extends IgniteCacheAb
cfg.setPeerClassLoadingEnabled(false);
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
return cfg;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java
index 2b31f50..00b7c0f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.IgniteCache;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -48,6 +49,8 @@ public class IgniteCacheSizeFailoverTest extends GridCommonAbstractTest {
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setCacheMode(PARTITIONED);
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteAtomicLongChangingTopologySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteAtomicLongChangingTopologySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteAtomicLongChangingTopologySelfTest.java
index 1f2e035..337334e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteAtomicLongChangingTopologySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteAtomicLongChangingTopologySelfTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -36,32 +37,22 @@ import java.util.concurrent.atomic.*;
*
*/
public class IgniteAtomicLongChangingTopologySelfTest extends GridCommonAbstractTest {
- /**
- * Grid count.
- */
+ /** Grid count. */
private static final int GRID_CNT = 5;
- /**
- * Restart count.
- */
+ /** Restart cound. */
private static final int RESTART_CNT = 15;
- /**
- * Atomic long name.
- */
+ /** Atomic long name. */
private static final String ATOMIC_LONG_NAME = "test-atomic-long";
- /**
- * Queue.
- */
+ /** Queue. */
private final Queue<Long> queue = new ConcurrentLinkedQueue<>();
/** */
private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -77,12 +68,12 @@ public class IgniteAtomicLongChangingTopologySelfTest extends GridCommonAbstract
cfg.setAtomicConfiguration(atomicCfg);
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
return cfg;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
stopAllGrids();
@@ -90,7 +81,7 @@ public class IgniteAtomicLongChangingTopologySelfTest extends GridCommonAbstract
}
/**
- *
+ * @throws Exception If failed.
*/
public void testQueueCreateNodesJoin() throws Exception {
CountDownLatch startLatch = new CountDownLatch(GRID_CNT);
http://git-wip-us.apache.org/repos/asf/ignite/blob/bfabab2d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java
index 7425e23..8500e97 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java
@@ -37,6 +37,7 @@ import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
@@ -91,6 +92,8 @@ public class IgniteCacheCrossCacheTxFailoverTest extends GridCommonAbstractTest
cfg.setSwapSpaceSpi(new FileSwapSpaceSpi());
+ ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
+
return cfg;
}
[7/7] ignite git commit: Merge remote-tracking branch
'remotes/origin/master' into ignite-1534
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-1534
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9bc077ed
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9bc077ed
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9bc077ed
Branch: refs/heads/ignite-1534
Commit: 9bc077ed0d984ded0aa4129194bfcee0535d2fbd
Parents: 9bb4411 c6ec7e1
Author: sboikov <sb...@gridgain.com>
Authored: Wed Sep 30 15:45:07 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Sep 30 15:45:07 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/igfs/IgfsPath.java | 2 +-
.../apache/ignite/internal/IgniteKernal.java | 70 +++---
.../internal/processors/igfs/IgfsFileInfo.java | 2 +-
.../internal/processors/igfs/IgfsImpl.java | 57 +----
.../processors/igfs/IgfsMetaManager.java | 251 +++++++++++++++----
.../ignite/internal/util/GridArgumentCheck.java | 5 +-
.../util/nio/GridNioRecoveryDescriptor.java | 4 +-
.../ignite/igfs/IgfsFragmentizerSelfTest.java | 2 +-
.../GridCacheAbstractFailoverSelfTest.java | 3 +
.../GridCacheAbstractRemoveFailureTest.java | 3 +
.../cache/IgniteCacheCreateRestartSelfTest.java | 3 +
...acheAsyncOperationsFailoverAbstractTest.java | 11 +
.../CachePutAllFailoverAbstractTest.java | 11 +
.../IgniteCachePutGetRestartAbstractTest.java | 3 +
.../IgniteCacheSizeFailoverTest.java | 3 +
...gniteAtomicLongChangingTopologySelfTest.java | 29 +--
.../IgniteCacheCrossCacheTxFailoverTest.java | 3 +
.../processors/igfs/IgfsAbstractSelfTest.java | 80 ++++--
.../igfs/IgfsMetaManagerSelfTest.java | 6 -
.../processors/igfs/IgfsMetricsSelfTest.java | 2 +-
.../processors/igfs/IgfsProcessorSelfTest.java | 29 +--
.../igfs/UniversalFileSystemAdapter.java | 1 -
.../processors/hadoop/igfs/HadoopIgfsUtils.java | 36 +++
...oopFileSystemUniversalFileSystemAdapter.java | 4 +-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 7 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 5 +-
.../processors/query/h2/sql/GridSqlArray.java | 52 ++++
.../processors/query/h2/sql/GridSqlElement.java | 2 +-
.../query/h2/sql/GridSqlFunction.java | 60 +++--
.../query/h2/sql/GridSqlFunctionType.java | 3 +
.../query/h2/sql/GridSqlPlaceholder.java | 7 +-
.../query/h2/sql/GridSqlQueryParser.java | 84 ++++---
.../processors/query/h2/sql/GridSqlType.java | 29 ++-
.../query/h2/sql/GridQueryParsingTest.java | 27 ++
34 files changed, 633 insertions(+), 263 deletions(-)
----------------------------------------------------------------------