# IGNITE-226: WIP.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/660587ed Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/660587ed Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/660587ed Branch: refs/heads/ignite-226 Commit: 660587ed7a23544c14de065a647d86fa6ceee49c Parents: cd5f9f0 Author: vozerov-gridgain <[email protected]> Authored: Fri Feb 13 14:41:16 2015 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Fri Feb 13 14:41:16 2015 +0300 ---------------------------------------------------------------------- .../eviction/igfs/CacheIgfsEvictionFilter.java | 35 ++ .../CacheIgfsPerBlockLruEvictionPolicy.java | 358 +++++++++++++++++++ ...acheIgfsPerBlockLruEvictionPolicyMXBean.java | 93 +++++ .../ignite/cache/eviction/igfs/package.html | 24 ++ .../ignitefs/CacheIgfsEvictionFilter.java | 35 -- .../CacheIgfsPerBlockLruEvictionPolicy.java | 358 ------------------- ...acheIgfsPerBlockLruEvictionPolicyMXBean.java | 93 ----- .../ignite/cache/eviction/ignitefs/package.html | 24 -- .../configuration/IgniteConfiguration.java | 12 +- .../ignite/igfs/mapreduce/records/package.html | 2 +- .../org/apache/ignite/internal/GridTopic.java | 2 +- .../org/apache/ignite/internal/IgnitionEx.java | 4 +- .../processors/cache/GridCacheAdapter.java | 6 +- .../processors/cache/GridCacheMapEntry.java | 4 +- .../processors/cache/GridCacheProjectionEx.java | 4 +- .../cache/GridCacheProjectionImpl.java | 8 +- .../processors/cache/GridCacheProxyImpl.java | 8 +- .../preloader/GridDhtPartitionDemandPool.java | 4 +- .../distributed/near/GridNearCacheAdapter.java | 12 +- .../processors/igfs/IgfsDataManager.java | 18 +- .../processors/igfs/IgfsDeleteWorker.java | 2 +- .../igfs/IgfsFragmentizerManager.java | 2 +- .../processors/igfs/IgfsHelperImpl.java | 2 +- .../internal/processors/igfs/IgfsImpl.java | 4 +- .../visor/ggfs/VisorIgfsProfilerClearTask.java | 2 +- .../visor/ggfs/VisorIgfsProfilerTask.java | 2 +- .../internal/visor/util/VisorTaskUtils.java | 2 +- .../ignite/igfs/IgfsEventsAbstractSelfTest.java | 68 ++-- .../communication/GridIoManagerSelfTest.java | 4 +- ...heIgfsPerBlockLruEvictionPolicySelfTest.java | 2 +- .../processors/igfs/IgfsSizeSelfTest.java | 2 +- .../IpcSharedMemoryCrashDetectionSelfTest.java | 4 +- .../ipc/shmem/IpcSharedMemoryNodeStartup.java | 12 +- 33 files changed, 606 insertions(+), 606 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java new file mode 100644 index 0000000..6c3cecc --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsEvictionFilter.java @@ -0,0 +1,35 @@ +/* + * 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.cache.eviction.igfs; + +import org.apache.ignite.cache.eviction.*; +import org.apache.ignite.internal.processors.igfs.*; + +import javax.cache.*; + +/** + * GGFS eviction filter which will not evict blocks of particular files. + */ +public class CacheIgfsEvictionFilter implements CacheEvictionFilter { + /** {@inheritDoc} */ + @Override public boolean evictAllowed(Cache.Entry entry) { + Object key = entry.getKey(); + + return !(key instanceof IgfsBlockKey && ((IgfsBlockKey)key).evictExclude()); + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicy.java new file mode 100644 index 0000000..b9e4646 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicy.java @@ -0,0 +1,358 @@ +/* + * 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.cache.eviction.igfs; + +import org.apache.ignite.*; +import org.apache.ignite.cache.eviction.*; +import org.apache.ignite.igfs.*; +import org.apache.ignite.internal.processors.cache.*; +import org.apache.ignite.internal.processors.igfs.*; +import org.jdk8.backport.*; +import org.jdk8.backport.ConcurrentLinkedDeque8.*; +import org.jetbrains.annotations.*; + +import java.util.*; +import java.util.concurrent.atomic.*; +import java.util.regex.*; + +/** + * GGFS eviction policy which evicts particular blocks. + */ +public class CacheIgfsPerBlockLruEvictionPolicy implements CacheEvictionPolicy<IgfsBlockKey, byte[]>, + CacheIgfsPerBlockLruEvictionPolicyMXBean { + /** Maximum size. When reached, eviction begins. */ + private volatile long maxSize; + + /** Maximum amount of blocks. When reached, eviction begins. */ + private volatile int maxBlocks; + + /** Collection of regex for paths which must not be evicted. */ + private volatile Collection<String> excludePaths; + + /** Exclusion patterns. */ + private volatile Collection<Pattern> excludePatterns; + + /** Whether patterns must be recompiled during the next call. */ + private final AtomicBoolean excludeRecompile = new AtomicBoolean(true); + + /** Queue. */ + private final ConcurrentLinkedDeque8<EvictableEntry<IgfsBlockKey, byte[]>> queue = + new ConcurrentLinkedDeque8<>(); + + /** Current size of all enqueued blocks in bytes. */ + private final LongAdder curSize = new LongAdder(); + + /** + * Default constructor. + */ + public CacheIgfsPerBlockLruEvictionPolicy() { + // No-op. + } + + /** + * Constructor. + * + * @param maxSize Maximum size. When reached, eviction begins. + * @param maxBlocks Maximum amount of blocks. When reached, eviction begins. + */ + public CacheIgfsPerBlockLruEvictionPolicy(long maxSize, int maxBlocks) { + this(maxSize, maxBlocks, null); + } + + /** + * Constructor. + * + * @param maxSize Maximum size. When reached, eviction begins. + * @param maxBlocks Maximum amount of blocks. When reached, eviction begins. + * @param excludePaths Collection of regex for path which must not be evicted. + */ + public CacheIgfsPerBlockLruEvictionPolicy(long maxSize, int maxBlocks, + @Nullable Collection<String> excludePaths) { + this.maxSize = maxSize; + this.maxBlocks = maxBlocks; + this.excludePaths = excludePaths; + } + + /** {@inheritDoc} */ + @Override public void onEntryAccessed(boolean rmv, EvictableEntry<IgfsBlockKey, byte[]> entry) { + if (!rmv) { + if (!entry.isCached()) + return; + + if (touch(entry)) + shrink(); + } + else { + MetaEntry meta = entry.removeMeta(); + + if (meta != null && queue.unlinkx(meta.node())) + changeSize(-meta.size()); + } + } + + /** + * @param entry Entry to touch. + * @return {@code True} if new node has been added to queue by this call. + */ + private boolean touch(EvictableEntry<IgfsBlockKey, byte[]> entry) { + byte[] val = peek(entry); + + int blockSize = val != null ? val.length : 0; + + MetaEntry meta = entry.meta(); + + // Entry has not been enqueued yet. + if (meta == null) { + while (true) { + Node<EvictableEntry<IgfsBlockKey, byte[]>> node = queue.offerLastx(entry); + + meta = new MetaEntry(node, blockSize); + + if (entry.putMetaIfAbsent(meta) != null) { + // Was concurrently added, need to clear it from queue. + queue.unlinkx(node); + + // Queue has not been changed. + return false; + } + else if (node.item() != null) { + if (!entry.isCached()) { + // Was concurrently evicted, need to clear it from queue. + queue.unlinkx(node); + + return false; + } + + // Increment current size. + changeSize(blockSize); + + return true; + } + // If node was unlinked by concurrent shrink() call, we must repeat the whole cycle. + else if (!entry.removeMeta(node)) + return false; + } + } + else { + int oldBlockSize = meta.size(); + + Node<EvictableEntry<IgfsBlockKey, byte[]>> node = meta.node(); + + if (queue.unlinkx(node)) { + // Move node to tail. + Node<EvictableEntry<IgfsBlockKey, byte[]>> newNode = queue.offerLastx(entry); + + int delta = blockSize - oldBlockSize; + + if (!entry.replaceMeta(meta, new MetaEntry(newNode, blockSize))) { + // Was concurrently added, need to clear it from queue. + if (queue.unlinkx(newNode)) + delta -= blockSize; + } + + if (delta != 0) { + changeSize(delta); + + if (delta > 0) + // Total size increased, so shrinking could be needed. + return true; + } + } + } + + // Entry is already in queue. + return false; + } + + /** + * @param entry Entry. + * @return Peeked value. + */ + @Nullable private byte[] peek(EvictableEntry<IgfsBlockKey, byte[]> entry) { + return (byte[])((EvictableEntryImpl)entry).peek(); + } + + /** + * Shrinks queue to maximum allowed size. + */ + private void shrink() { + long maxSize = this.maxSize; + int maxBlocks = this.maxBlocks; + + int cnt = queue.sizex(); + + for (int i = 0; i < cnt && (maxBlocks > 0 && queue.sizex() > maxBlocks || + maxSize > 0 && curSize.longValue() > maxSize); i++) { + EvictableEntry<IgfsBlockKey, byte[]> entry = queue.poll(); + + if (entry == null) + break; // Queue is empty. + + byte[] val = peek(entry); + + if (val != null) + changeSize(-val.length); // Change current size as we polled entry from the queue. + + if (!entry.evict()) { + // Reorder entries which we failed to evict. + entry.removeMeta(); + + touch(entry); + } + } + } + + /** + * Change current size. + * + * @param delta Delta in bytes. + */ + private void changeSize(int delta) { + if (delta != 0) + curSize.add(delta); + } + + /** {@inheritDoc} */ + @Override public long getMaxSize() { + return maxSize; + } + + /** {@inheritDoc} */ + @Override public void setMaxSize(long maxSize) { + this.maxSize = maxSize; + } + + /** {@inheritDoc} */ + @Override public int getMaxBlocks() { + return maxBlocks; + } + + /** {@inheritDoc} */ + @Override public void setMaxBlocks(int maxBlocks) { + this.maxBlocks = maxBlocks; + } + + /** {@inheritDoc} */ + @Override public Collection<String> getExcludePaths() { + return Collections.unmodifiableCollection(excludePaths); + } + + /** {@inheritDoc} */ + @Override public void setExcludePaths(@Nullable Collection<String> excludePaths) { + this.excludePaths = excludePaths; + + excludeRecompile.set(true); + } + + /** {@inheritDoc} */ + @Override public long getCurrentSize() { + return curSize.longValue(); + } + + /** {@inheritDoc} */ + @Override public int getCurrentBlocks() { + return queue.size(); + } + + /** + * Check whether provided path must be excluded from evictions. + * + * @param path Path. + * @return {@code True} in case non block of related file must be excluded. + * @throws IgniteCheckedException In case of faulty patterns. + */ + public boolean exclude(IgfsPath path) throws IgniteCheckedException { + assert path != null; + + Collection<Pattern> excludePatterns0; + + if (excludeRecompile.compareAndSet(true, false)) { + // Recompile. + Collection<String> excludePaths0 = excludePaths; + + if (excludePaths0 != null) { + excludePatterns0 = new HashSet<>(excludePaths0.size(), 1.0f); + + for (String excludePath : excludePaths0) { + try { + excludePatterns0.add(Pattern.compile(excludePath)); + } + catch (PatternSyntaxException ignore) { + throw new IgniteCheckedException("Invalid regex pattern: " + excludePath); + } + } + + excludePatterns = excludePatterns0; + } + else + excludePatterns0 = excludePatterns = null; + } + else + excludePatterns0 = excludePatterns; + + if (excludePatterns0 != null) { + String pathStr = path.toString(); + + for (Pattern pattern : excludePatterns0) { + if (pattern.matcher(pathStr).matches()) + return true; + } + } + + return false; + } + + /** + * Meta entry. + */ + private static class MetaEntry { + /** Queue node. */ + private final Node<EvictableEntry<IgfsBlockKey, byte[]>> node; + + /** Data size. */ + private final int size; + + /** + * Constructor. + * + * @param node Queue node. + * @param size Data size. + */ + private MetaEntry(Node<EvictableEntry<IgfsBlockKey, byte[]>> node, int size) { + assert node != null; + assert size >= 0; + + this.node = node; + this.size = size; + } + + /** + * @return Queue node. + */ + private Node<EvictableEntry<IgfsBlockKey, byte[]>> node() { + return node; + } + + /** + * @return Data size. + */ + private int size() { + return size; + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java new file mode 100644 index 0000000..e5bd436 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java @@ -0,0 +1,93 @@ +/* + * 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.cache.eviction.igfs; + +import org.apache.ignite.mxbean.*; +import org.jetbrains.annotations.*; + +import java.util.*; + +/** + * MBean for {@code GGFS per-block LRU} eviction policy. + */ +@MXBeanDescription("MBean for GGFS per-block LRU cache eviction policy.") +public interface CacheIgfsPerBlockLruEvictionPolicyMXBean { + /** + * Gets maximum allowed size of all blocks in bytes. + * + * @return Maximum allowed size of all blocks in bytes. + */ + @MXBeanDescription("Maximum allowed size of all blocks in bytes.") + public long getMaxSize(); + + /** + * Sets maximum allowed size of data in all blocks in bytes. + * + * @param maxSize Maximum allowed size of data in all blocks in bytes. + */ + @MXBeanDescription("Sets aximum allowed size of data in all blocks in bytes.") + public void setMaxSize(long maxSize); + + /** + * Gets maximum allowed amount of blocks. + * + * @return Maximum allowed amount of blocks. + */ + @MXBeanDescription("Maximum allowed amount of blocks.") + public int getMaxBlocks(); + + /** + * Sets maximum allowed amount of blocks. + * + * @param maxBlocks Maximum allowed amount of blocks. + */ + @MXBeanDescription("Sets maximum allowed amount of blocks.") + public void setMaxBlocks(int maxBlocks); + + /** + * Gets collection of regex for paths whose blocks must not be evicted. + * + * @return Collection of regex for paths whose blocks must not be evicted. + */ + @MXBeanDescription("Collection of regex for paths whose blocks must not be evicted.") + @Nullable public Collection<String> getExcludePaths(); + + /** + * Sets collection of regex for paths whose blocks must not be evicted. + * + * @param excludePaths Collection of regex for paths whose blocks must not be evicted. + */ + @MXBeanDescription("Sets collection of regex for paths whose blocks must not be evicted.") + public void setExcludePaths(@Nullable Collection<String> excludePaths); + + /** + * Gets current size of data in all blocks. + * + * @return Current size of data in all blocks. + */ + @MXBeanDescription("Current size of data in all blocks.") + public long getCurrentSize(); + + /** + * Gets current amount of blocks. + * + * @return Current amount of blocks. + */ + @MXBeanDescription("Current amount of blocks.") + public int getCurrentBlocks(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/package.html ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/package.html b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/package.html new file mode 100644 index 0000000..b703700 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/igfs/package.html @@ -0,0 +1,24 @@ +<!-- + 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. +--> + +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<body> +<!-- Package description. --> +Contains IGFS LRU eviction policy implementations. +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java deleted file mode 100644 index a6da344..0000000 --- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.cache.eviction.ignitefs; - -import org.apache.ignite.cache.eviction.*; -import org.apache.ignite.internal.processors.igfs.*; - -import javax.cache.*; - -/** - * GGFS eviction filter which will not evict blocks of particular files. - */ -public class CacheIgfsEvictionFilter implements CacheEvictionFilter { - /** {@inheritDoc} */ - @Override public boolean evictAllowed(Cache.Entry entry) { - Object key = entry.getKey(); - - return !(key instanceof IgfsBlockKey && ((IgfsBlockKey)key).evictExclude()); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java deleted file mode 100644 index 11b469b..0000000 --- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * 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.cache.eviction.ignitefs; - -import org.apache.ignite.*; -import org.apache.ignite.cache.eviction.*; -import org.apache.ignite.igfs.*; -import org.apache.ignite.internal.processors.cache.*; -import org.apache.ignite.internal.processors.igfs.*; -import org.jdk8.backport.*; -import org.jdk8.backport.ConcurrentLinkedDeque8.*; -import org.jetbrains.annotations.*; - -import java.util.*; -import java.util.concurrent.atomic.*; -import java.util.regex.*; - -/** - * GGFS eviction policy which evicts particular blocks. - */ -public class CacheIgfsPerBlockLruEvictionPolicy implements CacheEvictionPolicy<IgfsBlockKey, byte[]>, - CacheIgfsPerBlockLruEvictionPolicyMXBean { - /** Maximum size. When reached, eviction begins. */ - private volatile long maxSize; - - /** Maximum amount of blocks. When reached, eviction begins. */ - private volatile int maxBlocks; - - /** Collection of regex for paths which must not be evicted. */ - private volatile Collection<String> excludePaths; - - /** Exclusion patterns. */ - private volatile Collection<Pattern> excludePatterns; - - /** Whether patterns must be recompiled during the next call. */ - private final AtomicBoolean excludeRecompile = new AtomicBoolean(true); - - /** Queue. */ - private final ConcurrentLinkedDeque8<EvictableEntry<IgfsBlockKey, byte[]>> queue = - new ConcurrentLinkedDeque8<>(); - - /** Current size of all enqueued blocks in bytes. */ - private final LongAdder curSize = new LongAdder(); - - /** - * Default constructor. - */ - public CacheIgfsPerBlockLruEvictionPolicy() { - // No-op. - } - - /** - * Constructor. - * - * @param maxSize Maximum size. When reached, eviction begins. - * @param maxBlocks Maximum amount of blocks. When reached, eviction begins. - */ - public CacheIgfsPerBlockLruEvictionPolicy(long maxSize, int maxBlocks) { - this(maxSize, maxBlocks, null); - } - - /** - * Constructor. - * - * @param maxSize Maximum size. When reached, eviction begins. - * @param maxBlocks Maximum amount of blocks. When reached, eviction begins. - * @param excludePaths Collection of regex for path which must not be evicted. - */ - public CacheIgfsPerBlockLruEvictionPolicy(long maxSize, int maxBlocks, - @Nullable Collection<String> excludePaths) { - this.maxSize = maxSize; - this.maxBlocks = maxBlocks; - this.excludePaths = excludePaths; - } - - /** {@inheritDoc} */ - @Override public void onEntryAccessed(boolean rmv, EvictableEntry<IgfsBlockKey, byte[]> entry) { - if (!rmv) { - if (!entry.isCached()) - return; - - if (touch(entry)) - shrink(); - } - else { - MetaEntry meta = entry.removeMeta(); - - if (meta != null && queue.unlinkx(meta.node())) - changeSize(-meta.size()); - } - } - - /** - * @param entry Entry to touch. - * @return {@code True} if new node has been added to queue by this call. - */ - private boolean touch(EvictableEntry<IgfsBlockKey, byte[]> entry) { - byte[] val = peek(entry); - - int blockSize = val != null ? val.length : 0; - - MetaEntry meta = entry.meta(); - - // Entry has not been enqueued yet. - if (meta == null) { - while (true) { - Node<EvictableEntry<IgfsBlockKey, byte[]>> node = queue.offerLastx(entry); - - meta = new MetaEntry(node, blockSize); - - if (entry.putMetaIfAbsent(meta) != null) { - // Was concurrently added, need to clear it from queue. - queue.unlinkx(node); - - // Queue has not been changed. - return false; - } - else if (node.item() != null) { - if (!entry.isCached()) { - // Was concurrently evicted, need to clear it from queue. - queue.unlinkx(node); - - return false; - } - - // Increment current size. - changeSize(blockSize); - - return true; - } - // If node was unlinked by concurrent shrink() call, we must repeat the whole cycle. - else if (!entry.removeMeta(node)) - return false; - } - } - else { - int oldBlockSize = meta.size(); - - Node<EvictableEntry<IgfsBlockKey, byte[]>> node = meta.node(); - - if (queue.unlinkx(node)) { - // Move node to tail. - Node<EvictableEntry<IgfsBlockKey, byte[]>> newNode = queue.offerLastx(entry); - - int delta = blockSize - oldBlockSize; - - if (!entry.replaceMeta(meta, new MetaEntry(newNode, blockSize))) { - // Was concurrently added, need to clear it from queue. - if (queue.unlinkx(newNode)) - delta -= blockSize; - } - - if (delta != 0) { - changeSize(delta); - - if (delta > 0) - // Total size increased, so shrinking could be needed. - return true; - } - } - } - - // Entry is already in queue. - return false; - } - - /** - * @param entry Entry. - * @return Peeked value. - */ - @Nullable private byte[] peek(EvictableEntry<IgfsBlockKey, byte[]> entry) { - return (byte[])((EvictableEntryImpl)entry).peek(); - } - - /** - * Shrinks queue to maximum allowed size. - */ - private void shrink() { - long maxSize = this.maxSize; - int maxBlocks = this.maxBlocks; - - int cnt = queue.sizex(); - - for (int i = 0; i < cnt && (maxBlocks > 0 && queue.sizex() > maxBlocks || - maxSize > 0 && curSize.longValue() > maxSize); i++) { - EvictableEntry<IgfsBlockKey, byte[]> entry = queue.poll(); - - if (entry == null) - break; // Queue is empty. - - byte[] val = peek(entry); - - if (val != null) - changeSize(-val.length); // Change current size as we polled entry from the queue. - - if (!entry.evict()) { - // Reorder entries which we failed to evict. - entry.removeMeta(); - - touch(entry); - } - } - } - - /** - * Change current size. - * - * @param delta Delta in bytes. - */ - private void changeSize(int delta) { - if (delta != 0) - curSize.add(delta); - } - - /** {@inheritDoc} */ - @Override public long getMaxSize() { - return maxSize; - } - - /** {@inheritDoc} */ - @Override public void setMaxSize(long maxSize) { - this.maxSize = maxSize; - } - - /** {@inheritDoc} */ - @Override public int getMaxBlocks() { - return maxBlocks; - } - - /** {@inheritDoc} */ - @Override public void setMaxBlocks(int maxBlocks) { - this.maxBlocks = maxBlocks; - } - - /** {@inheritDoc} */ - @Override public Collection<String> getExcludePaths() { - return Collections.unmodifiableCollection(excludePaths); - } - - /** {@inheritDoc} */ - @Override public void setExcludePaths(@Nullable Collection<String> excludePaths) { - this.excludePaths = excludePaths; - - excludeRecompile.set(true); - } - - /** {@inheritDoc} */ - @Override public long getCurrentSize() { - return curSize.longValue(); - } - - /** {@inheritDoc} */ - @Override public int getCurrentBlocks() { - return queue.size(); - } - - /** - * Check whether provided path must be excluded from evictions. - * - * @param path Path. - * @return {@code True} in case non block of related file must be excluded. - * @throws IgniteCheckedException In case of faulty patterns. - */ - public boolean exclude(IgfsPath path) throws IgniteCheckedException { - assert path != null; - - Collection<Pattern> excludePatterns0; - - if (excludeRecompile.compareAndSet(true, false)) { - // Recompile. - Collection<String> excludePaths0 = excludePaths; - - if (excludePaths0 != null) { - excludePatterns0 = new HashSet<>(excludePaths0.size(), 1.0f); - - for (String excludePath : excludePaths0) { - try { - excludePatterns0.add(Pattern.compile(excludePath)); - } - catch (PatternSyntaxException ignore) { - throw new IgniteCheckedException("Invalid regex pattern: " + excludePath); - } - } - - excludePatterns = excludePatterns0; - } - else - excludePatterns0 = excludePatterns = null; - } - else - excludePatterns0 = excludePatterns; - - if (excludePatterns0 != null) { - String pathStr = path.toString(); - - for (Pattern pattern : excludePatterns0) { - if (pattern.matcher(pathStr).matches()) - return true; - } - } - - return false; - } - - /** - * Meta entry. - */ - private static class MetaEntry { - /** Queue node. */ - private final Node<EvictableEntry<IgfsBlockKey, byte[]>> node; - - /** Data size. */ - private final int size; - - /** - * Constructor. - * - * @param node Queue node. - * @param size Data size. - */ - private MetaEntry(Node<EvictableEntry<IgfsBlockKey, byte[]>> node, int size) { - assert node != null; - assert size >= 0; - - this.node = node; - this.size = size; - } - - /** - * @return Queue node. - */ - private Node<EvictableEntry<IgfsBlockKey, byte[]>> node() { - return node; - } - - /** - * @return Data size. - */ - private int size() { - return size; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java deleted file mode 100644 index 3e1c7c2..0000000 --- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicyMXBean.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.cache.eviction.ignitefs; - -import org.apache.ignite.mxbean.*; -import org.jetbrains.annotations.*; - -import java.util.*; - -/** - * MBean for {@code GGFS per-block LRU} eviction policy. - */ -@MXBeanDescription("MBean for GGFS per-block LRU cache eviction policy.") -public interface CacheIgfsPerBlockLruEvictionPolicyMXBean { - /** - * Gets maximum allowed size of all blocks in bytes. - * - * @return Maximum allowed size of all blocks in bytes. - */ - @MXBeanDescription("Maximum allowed size of all blocks in bytes.") - public long getMaxSize(); - - /** - * Sets maximum allowed size of data in all blocks in bytes. - * - * @param maxSize Maximum allowed size of data in all blocks in bytes. - */ - @MXBeanDescription("Sets aximum allowed size of data in all blocks in bytes.") - public void setMaxSize(long maxSize); - - /** - * Gets maximum allowed amount of blocks. - * - * @return Maximum allowed amount of blocks. - */ - @MXBeanDescription("Maximum allowed amount of blocks.") - public int getMaxBlocks(); - - /** - * Sets maximum allowed amount of blocks. - * - * @param maxBlocks Maximum allowed amount of blocks. - */ - @MXBeanDescription("Sets maximum allowed amount of blocks.") - public void setMaxBlocks(int maxBlocks); - - /** - * Gets collection of regex for paths whose blocks must not be evicted. - * - * @return Collection of regex for paths whose blocks must not be evicted. - */ - @MXBeanDescription("Collection of regex for paths whose blocks must not be evicted.") - @Nullable public Collection<String> getExcludePaths(); - - /** - * Sets collection of regex for paths whose blocks must not be evicted. - * - * @param excludePaths Collection of regex for paths whose blocks must not be evicted. - */ - @MXBeanDescription("Sets collection of regex for paths whose blocks must not be evicted.") - public void setExcludePaths(@Nullable Collection<String> excludePaths); - - /** - * Gets current size of data in all blocks. - * - * @return Current size of data in all blocks. - */ - @MXBeanDescription("Current size of data in all blocks.") - public long getCurrentSize(); - - /** - * Gets current amount of blocks. - * - * @return Current amount of blocks. - */ - @MXBeanDescription("Current amount of blocks.") - public int getCurrentBlocks(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/package.html ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/package.html b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/package.html deleted file mode 100644 index 41c295f..0000000 --- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/package.html +++ /dev/null @@ -1,24 +0,0 @@ -<!-- - 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. ---> - -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<body> -<!-- Package description. --> -Contains GGFS LRU eviction policy implementations. -</body> -</html> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java index b86a3ac..ebaaff6 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java @@ -206,7 +206,7 @@ public class IgniteConfiguration { private int mgmtPoolSize = DFLT_MGMT_THREAD_CNT; /** GGFS pool size. */ - private int ggfsPoolSize = AVAILABLE_PROC_CNT; + private int igfsPoolSize = AVAILABLE_PROC_CNT; /** Lifecycle email notification. */ private boolean lifeCycleEmailNtf = true; @@ -474,7 +474,7 @@ public class IgniteConfiguration { ggWork = cfg.getWorkDirectory(); gridName = cfg.getGridName(); igfsCfg = cfg.getIgfsConfiguration(); - ggfsPoolSize = cfg.getGgfsThreadPoolSize(); + igfsPoolSize = cfg.getIgfsThreadPoolSize(); hadoopCfg = cfg.getHadoopConfiguration(); inclEvtTypes = cfg.getIncludeEventTypes(); includeProps = cfg.getIncludeProperties(); @@ -1000,8 +1000,8 @@ public class IgniteConfiguration { * * @return Thread pool size to be used for GGFS outgoing message sending. */ - public int getGgfsThreadPoolSize() { - return ggfsPoolSize; + public int getIgfsThreadPoolSize() { + return igfsPoolSize; } /** @@ -1048,10 +1048,10 @@ public class IgniteConfiguration { * Set thread pool size that will be used to process outgoing GGFS messages. * * @param poolSize Executor service to use for outgoing GGFS messages. - * @see IgniteConfiguration#getGgfsThreadPoolSize() + * @see IgniteConfiguration#getIgfsThreadPoolSize() */ public void setGgfsThreadPoolSize(int poolSize) { - this.ggfsPoolSize = poolSize; + this.igfsPoolSize = poolSize; } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/records/package.html ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/records/package.html b/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/records/package.html index 6e35365..f6b29f5 100644 --- a/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/records/package.html +++ b/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/records/package.html @@ -19,6 +19,6 @@ <html> <body> <!-- Package description. --> - Contains record resolvers for In-Memory MapReduce over GGFS. + Contains record resolvers for In-Memory MapReduce over IGFS. </body> </html> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java index 7aa717f..32bab16 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTopic.java @@ -67,7 +67,7 @@ public enum GridTopic { TOPIC_REPLICATION, /** */ - TOPIC_GGFS, + TOPIC_IGFS, /** */ TOPIC_DATALOAD, http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java index c542d42..0027d70 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java @@ -1504,8 +1504,8 @@ public class IgnitionEx { // Note that we do not pre-start threads here as igfs pool may not be needed. ggfsExecSvc = new IgniteThreadPoolExecutor( "igfs-" + cfg.getGridName(), - cfg.getGgfsThreadPoolSize(), - cfg.getGgfsThreadPoolSize(), + cfg.getIgfsThreadPoolSize(), + cfg.getIgfsThreadPoolSize(), 0, new LinkedBlockingQueue<Runnable>()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java index db51d98..7de1b26 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java @@ -4745,7 +4745,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public boolean isGgfsDataCache() { + @Override public boolean isIgfsDataCache() { return ggfsDataCache; } @@ -4757,7 +4757,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, } /** {@inheritDoc} */ - @Override public long ggfsDataSpaceMax() { + @Override public long igfsDataSpaceMax() { return ggfsDataSpaceMax; } @@ -4776,7 +4776,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>, * * @param delta Size delta. */ - public void onGgfsDataSizeChanged(long delta) { + public void onIgfsDataSizeChanged(long delta) { assert ggfsDataCache; ggfsDataCacheSize.add(delta); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index 3fb8289..d640bc1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -195,7 +195,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V> assert Thread.holdsLock(this); // In case we deal with GGFS cache, count updated data - if (cctx.cache().isGgfsDataCache() && cctx.kernalContext().ggfsHelper().isIgfsBlockKey(key())) { + if (cctx.cache().isIgfsDataCache() && cctx.kernalContext().ggfsHelper().isIgfsBlockKey(key())) { int newSize = valueLength((byte[])val, valBytes != null ? GridCacheValueBytes.marshaled(valBytes) : GridCacheValueBytes.nil()); int oldSize = valueLength((byte[])this.val, this.val == null ? valueBytesUnlocked() : @@ -204,7 +204,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V> int delta = newSize - oldSize; if (delta != 0 && !cctx.isNear()) - cctx.cache().onGgfsDataSizeChanged(delta); + cctx.cache().onIgfsDataSizeChanged(delta); } if (!isOffHeapValuesOnly()) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java index 8a1a965..5b2ac77 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionEx.java @@ -337,7 +337,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * * @return {@code True} in case this cache is GGFS data cache. */ - public boolean isGgfsDataCache(); + public boolean isIgfsDataCache(); /** * Get current amount of used GGFS space in bytes. @@ -351,7 +351,7 @@ public interface GridCacheProjectionEx<K, V> extends CacheProjection<K, V> { * * @return Amount of space available for GGFS in bytes. */ - public long ggfsDataSpaceMax(); + public long igfsDataSpaceMax(); /** * Checks whether this cache is Mongo data cache. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java index 6d65b3d..f1f9627 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java @@ -708,8 +708,8 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public boolean isGgfsDataCache() { - return cache.isGgfsDataCache(); + @Override public boolean isIgfsDataCache() { + return cache.isIgfsDataCache(); } /** {@inheritDoc} */ @@ -718,8 +718,8 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V } /** {@inheritDoc} */ - @Override public long ggfsDataSpaceMax() { - return cache.ggfsDataSpaceMax(); + @Override public long igfsDataSpaceMax() { + return cache.igfsDataSpaceMax(); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java index da2e30f..65974cc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java @@ -553,11 +553,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public boolean isGgfsDataCache() { + @Override public boolean isIgfsDataCache() { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.isGgfsDataCache(); + return delegate.isIgfsDataCache(); } finally { gate.leave(prev); @@ -577,11 +577,11 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K, V>, Externali } /** {@inheritDoc} */ - @Override public long ggfsDataSpaceMax() { + @Override public long igfsDataSpaceMax() { GridCacheProjectionImpl<K, V> prev = gate.enter(prj); try { - return delegate.ggfsDataSpaceMax(); + return delegate.igfsDataSpaceMax(); } finally { gate.leave(prev); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java index 8322ca1..8093496 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandPool.java @@ -492,8 +492,8 @@ public class GridDhtPartitionDemandPool<K, V> { if (log.isDebugEnabled()) log.debug("Preloading key [key=" + entry.key() + ", part=" + p + ", node=" + pick.id() + ']'); - if (cctx.dht().isGgfsDataCache() && - cctx.dht().igfsDataSpaceUsed() > cctx.dht().ggfsDataSpaceMax()) { + if (cctx.dht().isIgfsDataCache() && + cctx.dht().igfsDataSpaceUsed() > cctx.dht().igfsDataSpaceMax()) { LT.error(log, null, "Failed to preload GGFS data cache (GGFS space size exceeded maximum " + "value, will ignore preload entries): " + name()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java index ab4a24e..7b87b24 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java @@ -628,8 +628,8 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda } /** {@inheritDoc} */ - @Override public boolean isGgfsDataCache() { - return dht().isGgfsDataCache(); + @Override public boolean isIgfsDataCache() { + return dht().isIgfsDataCache(); } /** {@inheritDoc} */ @@ -638,13 +638,13 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda } /** {@inheritDoc} */ - @Override public long ggfsDataSpaceMax() { - return dht().ggfsDataSpaceMax(); + @Override public long igfsDataSpaceMax() { + return dht().igfsDataSpaceMax(); } /** {@inheritDoc} */ - @Override public void onGgfsDataSizeChanged(long delta) { - dht().onGgfsDataSizeChanged(delta); + @Override public void onIgfsDataSizeChanged(long delta) { + dht().onIgfsDataSizeChanged(delta); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java index 089ab41..509ca3a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDataManager.java @@ -175,7 +175,7 @@ public class IgfsDataManager extends IgfsManager { String ggfsName = igfsCtx.configuration().getName(); - topic = F.isEmpty(ggfsName) ? TOPIC_GGFS : TOPIC_GGFS.topic(ggfsName); + topic = F.isEmpty(ggfsName) ? TOPIC_IGFS : TOPIC_IGFS.topic(ggfsName); igfsCtx.kernalContext().io().addMessageListener(topic, new GridMessageListener() { @Override public void onMessage(UUID nodeId, Object msg) { @@ -259,7 +259,7 @@ public class IgfsDataManager extends IgfsManager { * @return Maximum number of bytes for GGFS data cache. */ public long maxSpaceSize() { - return dataCachePrj.ggfsDataSpaceMax(); + return dataCachePrj.igfsDataSpaceMax(); } /** @@ -1077,7 +1077,7 @@ public class IgfsDataManager extends IgfsManager { */ private void processPartialBlockWrite(IgniteUuid fileId, IgfsBlockKey colocatedKey, int startOff, byte[] data) throws IgniteCheckedException { - if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { + if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.igfsDataSpaceMax()) { try { igfs.awaitDeletesAsync().get(trashPurgeTimeout); } @@ -1086,7 +1086,7 @@ public class IgfsDataManager extends IgfsManager { } // Additional size check. - if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { + if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.igfsDataSpaceMax()) { final WriteCompletionFuture completionFut = pendingWrites.get(fileId); if (completionFut == null) { @@ -1099,7 +1099,7 @@ public class IgfsDataManager extends IgfsManager { IgfsOutOfSpaceException e = new IgfsOutOfSpaceException("Failed to write data block " + "(GGFS maximum data size exceeded) [used=" + dataCachePrj.igfsDataSpaceUsed() + - ", allowed=" + dataCachePrj.ggfsDataSpaceMax() + ']'); + ", allowed=" + dataCachePrj.igfsDataSpaceMax() + ']'); completionFut.onDone(new IgniteCheckedException("Failed to write data (not enough space on node): " + igfsCtx.kernalContext().localNodeId(), e)); @@ -1246,7 +1246,7 @@ public class IgfsDataManager extends IgfsManager { private IgniteInternalFuture<?> storeBlocksAsync(Map<IgfsBlockKey, byte[]> blocks) { assert !blocks.isEmpty(); - if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) { + if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.igfsDataSpaceMax()) { try { try { igfs.awaitDeletesAsync().get(trashPurgeTimeout); @@ -1256,11 +1256,11 @@ public class IgfsDataManager extends IgfsManager { } // Additional size check. - if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.ggfsDataSpaceMax()) + if (dataCachePrj.igfsDataSpaceUsed() >= dataCachePrj.igfsDataSpaceMax()) return new GridFinishedFuture<Object>(igfsCtx.kernalContext(), new IgfsOutOfSpaceException("Failed to write data block (GGFS maximum data size " + "exceeded) [used=" + dataCachePrj.igfsDataSpaceUsed() + - ", allowed=" + dataCachePrj.ggfsDataSpaceMax() + ']')); + ", allowed=" + dataCachePrj.igfsDataSpaceMax() + ']')); } catch (IgniteCheckedException e) { @@ -1363,7 +1363,7 @@ public class IgfsDataManager extends IgfsManager { } // Check if we have enough free space to do colocated writes. - if (dataCachePrj.igfsDataSpaceUsed() > dataCachePrj.ggfsDataSpaceMax() * + if (dataCachePrj.igfsDataSpaceUsed() > dataCachePrj.igfsDataSpaceMax() * igfsCtx.configuration().getFragmentizerLocalWritesRatio()) { // Forbid further co-location. locRange.markDone(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java index 8da51b1..151e16c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteWorker.java @@ -93,7 +93,7 @@ public class IgfsDeleteWorker extends IgfsThread { String ggfsName = ggfsCtx.igfs().name(); - topic = F.isEmpty(ggfsName) ? TOPIC_GGFS : TOPIC_GGFS.topic(ggfsName); + topic = F.isEmpty(ggfsName) ? TOPIC_IGFS : TOPIC_IGFS.topic(ggfsName); assert meta != null; assert data != null; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java index 65b309c..b999ecc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerManager.java @@ -97,7 +97,7 @@ public class IgfsFragmentizerManager extends IgfsManager { String ggfsName = igfsCtx.configuration().getName(); - topic = F.isEmpty(ggfsName) ? TOPIC_GGFS : TOPIC_GGFS.topic(ggfsName); + topic = F.isEmpty(ggfsName) ? TOPIC_IGFS : TOPIC_IGFS.topic(ggfsName); igfsCtx.kernalContext().io().addMessageListener(topic, fragmentizerWorker); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsHelperImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsHelperImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsHelperImpl.java index 6314ec3..17210b0 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsHelperImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsHelperImpl.java @@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.igfs; import org.apache.ignite.*; import org.apache.ignite.cache.eviction.*; -import org.apache.ignite.cache.eviction.ignitefs.*; +import org.apache.ignite.cache.eviction.igfs.*; import org.apache.ignite.configuration.*; /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/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 227bafc..c943f61 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 @@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.igfs; import org.apache.ignite.*; import org.apache.ignite.cache.eviction.*; -import org.apache.ignite.cache.eviction.ignitefs.*; +import org.apache.ignite.cache.eviction.igfs.*; import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; import org.apache.ignite.configuration.*; @@ -207,7 +207,7 @@ public final class IgfsImpl implements IgfsEx { } } - topic = F.isEmpty(name()) ? TOPIC_GGFS : TOPIC_GGFS.topic(name()); + topic = F.isEmpty(name()) ? TOPIC_IGFS : TOPIC_IGFS.topic(name()); ggfsCtx.kernalContext().io().addMessageListener(topic, delMsgLsnr); ggfsCtx.kernalContext().event().addLocalEventListener(delDiscoLsnr, EVT_NODE_LEFT, EVT_NODE_FAILED); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerClearTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerClearTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerClearTask.java index 0065cc8..3c0928d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerClearTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerClearTask.java @@ -61,7 +61,7 @@ public class VisorIgfsProfilerClearTask extends VisorOneNodeTask<String, IgniteB try { IgniteFs ggfs = ignite.fileSystem(arg); - Path logsDir = resolveGgfsProfilerLogsDir(ggfs); + Path logsDir = resolveIgfsProfilerLogsDir(ggfs); if (logsDir != null) { PathMatcher matcher = FileSystems.getDefault().getPathMatcher( http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerTask.java index 254f541..a6db72d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/ggfs/VisorIgfsProfilerTask.java @@ -162,7 +162,7 @@ public class VisorIgfsProfilerTask extends VisorOneNodeTask<String, Collection<V /** {@inheritDoc} */ @Override protected Collection<VisorIgfsProfilerEntry> run(String arg) { try { - Path logsDir = resolveGgfsProfilerLogsDir(ignite.fileSystem(arg)); + Path logsDir = resolveIgfsProfilerLogsDir(ignite.fileSystem(arg)); if (logsDir != null) return parse(logsDir, arg); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java index dce8483..11c88fa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java @@ -603,7 +603,7 @@ public class VisorTaskUtils { * @return {@link Path} to log dir or {@code null} if not found. * @throws IgniteCheckedException if failed to resolve. */ - public static Path resolveGgfsProfilerLogsDir(IgniteFs igfs) throws IgniteCheckedException { + public static Path resolveIgfsProfilerLogsDir(IgniteFs igfs) throws IgniteCheckedException { String logsDir; if (igfs instanceof IgfsEx) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java index 1050c8c..3313185 100644 --- a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java @@ -44,7 +44,7 @@ import static org.apache.ignite.testframework.GridTestUtils.*; */ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest { /** GGFS. */ - private static IgfsImpl ggfs; + private static IgfsImpl igfs; /** Event listener. */ private IgnitePredicate<Event> lsnr; @@ -158,7 +158,7 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest @Override protected void beforeTestsStarted() throws Exception { Ignite ignite = startGrid(1); - ggfs = (IgfsImpl) ignite.fileSystems().iterator().next(); + igfs = (IgfsImpl) ignite.fileSystems().iterator().next(); } /** {@inheritDoc} */ @@ -170,7 +170,7 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest } // Clean up file system. - ggfs.format(); + igfs.format(); } /** {@inheritDoc} */ @@ -208,14 +208,14 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest // Will generate 3 EVT_GGFS_DIR_CREATED + EVT_GGFS_FILE_CREATED + EVT_GGFS_FILE_OPENED_WRITE + // EVT_GGFS_FILE_CLOSED and a number of EVT_GGFS_META_UPDATED. - ggfs.create(file, true).close(); + igfs.create(file, true).close(); IgfsPath mvFile = new IgfsPath(dir, "mvFile1"); - ggfs.rename(file, mvFile); // Will generate EVT_GGFS_FILE_RENAMED. + igfs.rename(file, mvFile); // Will generate EVT_GGFS_FILE_RENAMED. // Will generate EVT_GGFS_DIR_DELETED event. - assertTrue(ggfs.delete(dir.parent(), true)); + assertTrue(igfs.delete(dir.parent(), true)); assertTrue(latch.await(10, TimeUnit.SECONDS)); @@ -290,14 +290,14 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest // Will generate EVT_GGFS_DIR_CREATED + EVT_GGFS_FILE_CREATED + EVT_GGFS_FILE_OPENED_WRITE + // EVT_GGFS_FILE_CLOSED_WRITE. - ggfs.create(file1, true).close(); + igfs.create(file1, true).close(); // Will generate EVT_GGFS_FILE_CREATED + EVT_GGFS_FILE_OPENED_WRITE + // EVT_GGFS_FILE_CLOSED. - ggfs.create(file2, true).close(); + igfs.create(file2, true).close(); // Will generate EVT_GGFS_DIR_DELETED event. - assertTrue(ggfs.delete(dir, true)); + assertTrue(igfs.delete(dir, true)); assertTrue(latch.await(10, TimeUnit.SECONDS)); @@ -366,15 +366,15 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest IgfsPath dir = new IgfsPath("/dir1"); - ggfs.mkdirs(dir); // Will generate EVT_GGFS_DIR_CREATED. + igfs.mkdirs(dir); // Will generate EVT_GGFS_DIR_CREATED. IgfsPath mvDir = new IgfsPath("/mvDir1"); - ggfs.rename(dir, mvDir); // Will generate EVT_GGFS_DIR_RENAMED. + igfs.rename(dir, mvDir); // Will generate EVT_GGFS_DIR_RENAMED. - assertFalse(ggfs.delete(dir, true)); // Will generate no event. + assertFalse(igfs.delete(dir, true)); // Will generate no event. - assertTrue(ggfs.delete(mvDir, true)); // Will generate EVT_GGFS_DIR_DELETED events. + assertTrue(igfs.delete(mvDir, true)); // Will generate EVT_GGFS_DIR_DELETED events. assertTrue(latch.await(10, TimeUnit.SECONDS)); @@ -426,18 +426,18 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest IgfsPath file1 = new IgfsPath(dir, "file1"); // Will generate EVT_GGFS_FILE_CREATED event + EVT_GGFS_DIR_CREATED event + OPEN + CLOSE. - ggfs.create(file1, true).close(); + igfs.create(file1, true).close(); IgfsPath file2 = new IgfsPath(dir, "file2"); - ggfs.create(file2, true).close(); // Will generate 1 EVT_GGFS_FILE_CREATED event + OPEN + CLOSE. + igfs.create(file2, true).close(); // Will generate 1 EVT_GGFS_FILE_CREATED event + OPEN + CLOSE. - assertTrue(ggfs.exists(dir)); - assertTrue(ggfs.exists(file1)); - assertTrue(ggfs.exists(file2)); + assertTrue(igfs.exists(dir)); + assertTrue(igfs.exists(file1)); + assertTrue(igfs.exists(file2)); - assertTrue(ggfs.delete(file1, false)); // Will generate 1 EVT_GGFS_FILE_DELETED and 1 EVT_GGFS_FILE_PURGED. - assertTrue(ggfs.delete(file2, false)); // Same. + assertTrue(igfs.delete(file1, false)); // Will generate 1 EVT_GGFS_FILE_DELETED and 1 EVT_GGFS_FILE_PURGED. + assertTrue(igfs.delete(file2, false)); // Same. assertTrue(latch.await(10, TimeUnit.SECONDS)); @@ -510,16 +510,16 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest IgfsPath dir = new IgfsPath("/dir1/dir2"); - ggfs.mkdirs(dir); // Will generate 2 EVT_GGFS_DIR_CREATED events. + igfs.mkdirs(dir); // Will generate 2 EVT_GGFS_DIR_CREATED events. try { - ggfs.delete(dir.parent(), false); // Will generate no events. + igfs.delete(dir.parent(), false); // Will generate no events. } catch (IgniteException ignore) { // No-op. } - assertTrue(ggfs.delete(dir, false)); // Will generate 1 EVT_GGFS_DIR_DELETED event. + assertTrue(igfs.delete(dir, false)); // Will generate 1 EVT_GGFS_DIR_DELETED event. assertTrue(latch.await(10, TimeUnit.SECONDS)); @@ -567,11 +567,11 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest IgfsPath file = new IgfsPath(dir, "file1"); // Will generate 2 EVT_GGFS_DIR_CREATED events + EVT_GGFS_FILE_CREATED_EVENT + OPEN + CLOSE. - ggfs.create(file, true).close(); + igfs.create(file, true).close(); - ggfs.rename(file, dir.parent()); // Will generate 1 EVT_GGFS_FILE_RENAMED. + igfs.rename(file, dir.parent()); // Will generate 1 EVT_GGFS_FILE_RENAMED. - assertTrue(ggfs.exists(new IgfsPath(dir.parent(), file.name()))); + assertTrue(igfs.exists(new IgfsPath(dir.parent(), file.name()))); assertTrue(latch.await(10, TimeUnit.SECONDS)); @@ -631,11 +631,11 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest IgfsPath dir = new IgfsPath("/dir1/dir2"); - assertFalse(ggfs.exists(dir.parent())); + assertFalse(igfs.exists(dir.parent())); - ggfs.mkdirs(dir); // Will generate 2 EVT_GGFS_DIR_RENAMED events. + igfs.mkdirs(dir); // Will generate 2 EVT_GGFS_DIR_RENAMED events. - assertTrue(ggfs.delete(dir.parent(), true)); // Will generate EVT_GGFS_DIR_DELETED event. + assertTrue(igfs.delete(dir.parent(), true)); // Will generate EVT_GGFS_DIR_DELETED event. assertTrue(latch.await(10, TimeUnit.SECONDS)); @@ -681,12 +681,12 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest final IgfsPath file = new IgfsPath("/file1"); - ggfs.create(file, false).close(); // Will generate create, open and close events. + igfs.create(file, false).close(); // Will generate create, open and close events. - ggfs.create(file, true).close(); // Will generate same event set + delete and purge events. + igfs.create(file, true).close(); // Will generate same event set + delete and purge events. try { - ggfs.create(file, false).close(); // Won't generate any event. + igfs.create(file, false).close(); // Won't generate any event. } catch (Exception ignore) { // No-op. @@ -782,12 +782,12 @@ public abstract class IgfsEventsAbstractSelfTest extends GridCommonAbstractTest byte[] buf = new byte[dataSize]; // Will generate GGFS_FILE_CREATED, GGFS_FILE_OPENED_WRITE, GGFS_FILE_CLOSED_WRITE. - try (IgfsOutputStream os = ggfs.create(file, false)) { + try (IgfsOutputStream os = igfs.create(file, false)) { os.write(buf); // Will generate no events. } // Will generate EVT_GGFS_FILE_OPENED_READ, GGFS_FILE_CLOSED_READ. - try (IgfsInputStream is = ggfs.open(file, 256)) { + try (IgfsInputStream is = igfs.open(file, 256)) { is.readFully(0, buf); // Will generate no events. } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java index d125375..a9f0203 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java @@ -132,7 +132,7 @@ public class GridIoManagerSelfTest extends GridCommonAbstractTest { GridIoManager ioMgr = spy(new TestGridIoManager(ctx)); try { - ioMgr.sendUserMessage(F.asList(locNode, rmtNode), msg, GridTopic.TOPIC_GGFS, false, 123L); + ioMgr.sendUserMessage(F.asList(locNode, rmtNode), msg, GridTopic.TOPIC_IGFS, false, 123L); } catch (IgniteCheckedException ignored) { // No-op. We are using mocks so real sending is impossible. @@ -156,7 +156,7 @@ public class GridIoManagerSelfTest extends GridCommonAbstractTest { GridIoManager ioMgr = spy(new TestGridIoManager(ctx)); try { - ioMgr.sendUserMessage(F.asList(locNode, rmtNode), msg, GridTopic.TOPIC_GGFS, true, 123L); + ioMgr.sendUserMessage(F.asList(locNode, rmtNode), msg, GridTopic.TOPIC_IGFS, true, 123L); } catch (Exception ignored) { // No-op. We are using mocks so real sending is impossible. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/GridCacheIgfsPerBlockLruEvictionPolicySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/GridCacheIgfsPerBlockLruEvictionPolicySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/GridCacheIgfsPerBlockLruEvictionPolicySelfTest.java index 1db7d9f..b0d5d86 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/GridCacheIgfsPerBlockLruEvictionPolicySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/GridCacheIgfsPerBlockLruEvictionPolicySelfTest.java @@ -19,7 +19,7 @@ package org.apache.ignite.internal.processors.igfs; import org.apache.ignite.*; import org.apache.ignite.cache.*; -import org.apache.ignite.cache.eviction.ignitefs.*; +import org.apache.ignite.cache.eviction.igfs.*; import org.apache.ignite.configuration.*; import org.apache.ignite.igfs.*; import org.apache.ignite.internal.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java index c88205e..97cbd8a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsSizeSelfTest.java @@ -311,7 +311,7 @@ public class IgfsSizeSelfTest extends IgfsCommonAbstractTest { GridCacheProjectionEx cache = (GridCacheProjectionEx)g.cachex(DATA_CACHE_NAME).cache(); - assert cache.isGgfsDataCache(); + assert cache.isIgfsDataCache(); } // Perform writes. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java index 75b82ef..fe2dd71 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryCrashDetectionSelfTest.java @@ -48,7 +48,7 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes /** * @throws Exception If failed. */ - public void testGgfsServerClientInteractionsUponClientKilling() throws Exception { + public void testIgfsServerClientInteractionsUponClientKilling() throws Exception { U.setWorkDirectory(null, U.getIgniteHome()); // Run server endpoint. @@ -92,7 +92,7 @@ public class IpcSharedMemoryCrashDetectionSelfTest extends GridCommonAbstractTes /** * @throws Exception If failed. */ - public void testGgfsClientServerInteractionsUponServerKilling() throws Exception { + public void testIgfsClientServerInteractionsUponServerKilling() throws Exception { Collection<Integer> shmemIdsBeforeInteractions = IpcSharedMemoryUtils.sharedMemoryIds(); info("Shared memory IDs before starting server-client interactions: " + shmemIdsBeforeInteractions); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/660587ed/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java index 1e0d175..400bbb1 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryNodeStartup.java @@ -41,7 +41,7 @@ public class IpcSharedMemoryNodeStartup { public static void main(String[] args) throws Exception{ IgniteConfiguration cfg = new IgniteConfiguration(); - IgfsConfiguration ggfsCfg = new IgfsConfiguration(); + IgfsConfiguration igfsCfg = new IgfsConfiguration(); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); @@ -54,13 +54,13 @@ public class IpcSharedMemoryNodeStartup { endpointCfg.put("type", "shmem"); endpointCfg.put("port", "10500"); - ggfsCfg.setIpcEndpointConfiguration(endpointCfg); + igfsCfg.setIpcEndpointConfiguration(endpointCfg); - ggfsCfg.setDataCacheName("partitioned"); - ggfsCfg.setMetaCacheName("partitioned"); - ggfsCfg.setName("igfs"); + igfsCfg.setDataCacheName("partitioned"); + igfsCfg.setMetaCacheName("partitioned"); + igfsCfg.setName("igfs"); - cfg.setIgfsConfiguration(ggfsCfg); + cfg.setIgfsConfiguration(igfsCfg); CacheConfiguration cacheCfg = new CacheConfiguration();
