ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject ignite git commit: IGNITE-5267 - Added missing class
Date Mon, 12 Jun 2017 05:22:58 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5267-merge-ea 6bf5ce46c -> 4dc81ca86


IGNITE-5267 - Added missing class


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4dc81ca8
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4dc81ca8
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4dc81ca8

Branch: refs/heads/ignite-5267-merge-ea
Commit: 4dc81ca86347107848328d1e2e206b796976fb23
Parents: 6bf5ce4
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Mon Jun 12 08:22:49 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Mon Jun 12 08:22:49 2017 +0300

----------------------------------------------------------------------
 .../pagemem/NoOpPageStoreManager.java           | 199 +++++++++++++++++++
 1 file changed, 199 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4dc81ca8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
new file mode 100644
index 0000000..4dfe69b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/NoOpPageStoreManager.java
@@ -0,0 +1,199 @@
+/*
+ * 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.cache.persistence.pagemem;
+
+import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.pagemem.FullPageId;
+import org.apache.ignite.internal.pagemem.PageIdUtils;
+import org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager;
+import org.apache.ignite.internal.processors.cache.CacheGroupContext;
+import org.apache.ignite.internal.processors.cache.CacheGroupDescriptor;
+import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import org.apache.ignite.internal.processors.cache.StoredCacheData;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.lang.IgniteFuture;
+
+/**
+ *
+ */
+public class NoOpPageStoreManager implements IgnitePageStoreManager {
+    /** */
+    private ConcurrentMap<FullPageId, AtomicInteger> allocators = new ConcurrentHashMap<>();
+
+    /** {@inheritDoc} */
+    @Override public void beginRecover() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void finishRecover() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void initializeForCache(CacheGroupDescriptor grpDesc,
+        StoredCacheData cacheData) throws IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void shutdownForCacheGroup(CacheGroupContext grp, boolean destroy) throws
IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onPartitionCreated(int grpId, int partId) throws IgniteCheckedException
{
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onPartitionDestroyed(int cacheId, int partId, int tag) throws IgniteCheckedException
{
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void read(int cacheId, long pageId, ByteBuffer pageBuf) throws IgniteCheckedException
{
+
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean exists(int cacheId, int partId) throws IgniteCheckedException
{
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readHeader(int cacheId, int partId, ByteBuffer buf) throws IgniteCheckedException
{
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(int cacheId, long pageId, ByteBuffer pageBuf, int tag) throws
IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void sync(int cacheId, int partId) throws IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void ensure(int cacheId, int partId) throws IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public long pageOffset(int cacheId, long pageId) throws IgniteCheckedException
{
+        return 0;
+    }
+
+    /** {@inheritDoc} */
+    @Override public long allocatePage(int cacheId, int partId, byte flags) throws IgniteCheckedException
{
+        long root = PageIdUtils.pageId(partId, flags, 0);
+
+        FullPageId fullId = new FullPageId(root, cacheId);
+
+        AtomicInteger allocator = allocators.get(fullId);
+
+        if (allocator == null)
+            allocator = F.addIfAbsent(allocators, fullId, new AtomicInteger(1));
+
+        return PageIdUtils.pageId(partId, flags, allocator.getAndIncrement());
+    }
+
+    /** {@inheritDoc} */
+    @Override public int pages(int cacheId, int partId) throws IgniteCheckedException {
+        long root = PageIdUtils.pageId(partId, (byte)0, 0);
+
+        FullPageId fullId = new FullPageId(root, cacheId);
+
+        AtomicInteger allocator = allocators.get(fullId);
+
+        if (allocator == null)
+            allocator = F.addIfAbsent(allocators, fullId, new AtomicInteger(2));
+
+        return allocator.get();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long metaPageId(int cacheId) {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void start(GridCacheSharedContext cctx) throws IgniteCheckedException
{
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void stop(boolean cancel) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onKernalStart(boolean reconnect) throws IgniteCheckedException
{
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onKernalStop(boolean cancel) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onDisconnected(IgniteFuture reconnectFut) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void printMemoryStats() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public Map<String, StoredCacheData> readCacheConfigurations() throws
IgniteCheckedException {
+        return Collections.emptyMap();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void storeCacheData(CacheGroupDescriptor grpDesc,
+        StoredCacheData cacheData) throws IgniteCheckedException {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasIndexStore(int grpId) {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onActivate(GridKernalContext kctx) {
+
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onDeActivate(GridKernalContext kctx) {
+
+    }
+}


Mime
View raw message