You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/02/20 11:07:58 UTC
[ignite] branch ignite-10639-3 created (now a847af1)
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a change to branch ignite-10639-3
in repository https://gitbox.apache.org/repos/asf/ignite.git.
at a847af1 IGNITE-10639 Docs update, style changes, and exceptions handling fixes
This branch includes the following new commits:
new a847af1 IGNITE-10639 Docs update, style changes, and exceptions handling fixes
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[ignite] 01/01: IGNITE-10639 Docs update, style changes,
and exceptions handling fixes
Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch ignite-10639-3
in repository https://gitbox.apache.org/repos/asf/ignite.git
commit a847af16aee70a79e138a3799b36eb51bb13e959
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Wed Feb 20 14:07:05 2019 +0300
IGNITE-10639 Docs update, style changes, and exceptions handling fixes
---
.../main/java/org/apache/ignite/internal/README.md | 12 +++++-
.../ignite/internal/processors/cache/README.md | 3 ++
.../CheckpointWriteProgressSupplier.java | 6 +--
.../GridCacheDatabaseSharedManager.java | 6 ++-
.../cache/persistence/pagemem/PageMemoryImpl.java | 2 +-
.../pagemem/IgniteThrottlingUnitTest.java | 10 ++---
.../pagemem/PagesWriteThrottleSandboxTest.java | 45 +++++++++++-----------
.../ignite/testsuites/IgnitePdsUnitTestSuite.java | 1 -
8 files changed, 48 insertions(+), 37 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/README.md b/modules/core/src/main/java/org/apache/ignite/internal/README.md
index 8d0f208..0ed8639 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/README.md
+++ b/modules/core/src/main/java/org/apache/ignite/internal/README.md
@@ -3,10 +3,18 @@ Apache Ignite Internals
Contains implementation classes for Apache Ignite.
-*Ignite Components*
+### Ignite Components
All internal Ignite components implements [GridComponent.java](GridComponent.java) - interface for
- [processors](processors) and for
- [managers](managers) - has associated SPI.
-Service Provider Interface (SPI) abbreviation is here because Apache Ignite was designed as a pluggable product. But Ignite users usually do not define own implementations.
\ No newline at end of file
+Service Provider Interface (SPI) abbreviation is here because Apache Ignite was designed as a pluggable product. But Ignite users usually do not define own implementations.
+
+### Contexts
+Ignite manages its components using Context used to access components and binding theirs to each other.
+Component-related context in the Apache Ignite is an implementation of [GridKernalContext.java](GridKernalContext.java).
+This context instance is usually referred in code as `kctx` or `ctx`.
+
+Higher-level context, cache shared context is also defined in [processors/cache](processors/cache)
+
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/README.md b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/README.md
index f8c50ce..19c5d70 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/README.md
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/README.md
@@ -1,5 +1,8 @@
Apache Ignite Cache Processors
------------------------------
+### Context
+[GridCacheSharedContext.java](GridCacheSharedContext.java) is a class which is used for binding cache-related managers.
+This context is shared by all caches defined. This context instance is usually referred in code as `sctx`, `cctx` or `ctx`.
### Native Persistence
Apache Ignite has its own [Native Persistence](persistence) - Implementation
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CheckpointWriteProgressSupplier.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CheckpointWriteProgressSupplier.java
index d20e8d4..596a65f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CheckpointWriteProgressSupplier.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CheckpointWriteProgressSupplier.java
@@ -24,17 +24,17 @@ import java.util.concurrent.atomic.AtomicInteger;
*/
public interface CheckpointWriteProgressSupplier {
/**
- * Counter for written checkpoint pages. Not null only if checkpoint is running.
+ * @return Counter for written checkpoint pages. Not <code>null</code> only if checkpoint is running.
*/
public AtomicInteger writtenPagesCounter();
/**
- * @return Counter for fsynced checkpoint pages. Not null only if checkpoint is running.
+ * @return Counter for fsynced checkpoint pages. Not <code>null</code> only if checkpoint is running.
*/
public AtomicInteger syncedPagesCounter();
/**
- * @return Counter for evicted pages during current checkpoint. Not null only if checkpoint is running.
+ * @return Counter for evicted pages during current checkpoint. Not <code>null</code> only if checkpoint is running.
*/
public AtomicInteger evictedPagesCntr();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 4cb5bd2..422b949 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -3480,7 +3480,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
try {
chp = markCheckpointBegin(tracker);
}
- catch (IgniteCheckedException e) {
+ catch (Exception e) {
if (curCpProgress != null)
curCpProgress.cpFinishFut.onDone(e);
@@ -3874,7 +3874,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
tracker.onLockWaitStart();
checkpointLock.writeLock().lock();
-
+
try {
assert curCpProgress == curr : "Concurrent checkpoint begin should not be happened";
@@ -4066,6 +4066,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
}
catch (RejectedExecutionException e) {
assert false : "Task should never be rejected by async runner";
+
+ throw new IgniteException(e); //to protect from disabled asserts and call to failure handler
}
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
index 0f4ca7d..ae30f0e 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java
@@ -330,7 +330,7 @@ public class PageMemoryImpl implements PageMemoryEx {
storeMgr = ctx.pageStore();
walMgr = ctx.wal();
encMgr = ctx.kernalContext().encryption();
- encryptionDisabled = ctx.gridConfig().getEncryptionSpi() instanceof NoopEncryptionSpi;
+ encryptionDisabled = ctx.gridConfig().getEncryptionSpi() instanceof NoopEncryptionSpi;
assert storeMgr != null;
assert walMgr != null;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IgniteThrottlingUnitTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IgniteThrottlingUnitTest.java
index 6f504da..070f3c9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IgniteThrottlingUnitTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IgniteThrottlingUnitTest.java
@@ -42,7 +42,7 @@ import static org.mockito.Mockito.when;
public class IgniteThrottlingUnitTest {
/** Per test timeout */
@Rule
- public Timeout globalTimeout = new Timeout((int) GridTestUtils.DFLT_TEST_TIMEOUT);
+ public Timeout globalTimeout = new Timeout((int)GridTestUtils.DFLT_TEST_TIMEOUT);
/** Logger. */
private IgniteLogger log = new NullLogger();
@@ -163,7 +163,7 @@ public class IgniteThrottlingUnitTest {
public void beginOfCp() {
PagesWriteSpeedBasedThrottle throttle = new PagesWriteSpeedBasedThrottle(pageMemory2g, null, stateChecker, log);
- assertTrue(throttle.getParkTime(0.01, 100,400000,
+ assertTrue(throttle.getParkTime(0.01, 100, 400000,
1,
20103,
23103) == 0);
@@ -213,10 +213,10 @@ public class IgniteThrottlingUnitTest {
public void tooMuchPagesMarkedDirty() {
PagesWriteSpeedBasedThrottle throttle = new PagesWriteSpeedBasedThrottle(pageMemory2g, null, stateChecker, log);
- // 363308 350004 348976 10604
+ // 363308 350004 348976 10604
long time = throttle.getParkTime(0.75,
((350004 + 348976) / 2),
- 350004-10604,
+ 350004 - 10604,
4,
279,
23933);
@@ -269,7 +269,7 @@ public class IgniteThrottlingUnitTest {
throttle.onMarkDirty(false);
- if(warnings.get()>0)
+ if (warnings.get() > 0)
break;
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java
index 058792c..743fc3b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottleSandboxTest.java
@@ -1,19 +1,19 @@
/*
-* 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.
-*/
+ * 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.io.Serializable;
@@ -21,10 +21,10 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.DataRegionMetrics;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.DataRegionMetrics;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
@@ -34,7 +34,7 @@ import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.WALMode;
import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
+import org.apache.ignite.internal.processors.cache.persistence.CheckpointWriteProgressSupplier;
import org.apache.ignite.internal.processors.cache.ratemetrics.HitRateMetrics;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -43,9 +43,8 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
/**
- * Test to visualize and debug {@link PagesWriteThrottle}.
- * Prints puts/gets rate, number of dirty pages, pages written in current checkpoint and pages in checkpoint buffer.
- * Not intended to be part of any test suite.
+ * Test to visualize and debug {@link PagesWriteThrottle}. Prints puts/gets rate, number of dirty pages, pages written
+ * in current checkpoint and pages in checkpoint buffer. Not intended to be part of any test suite.
*/
public class PagesWriteThrottleSandboxTest extends GridCommonAbstractTest {
/** Cache name. */
@@ -148,7 +147,7 @@ public class PagesWriteThrottleSandboxTest extends GridCommonAbstractTest {
long cpWrittenPages;
- AtomicInteger cntr = ((GridCacheDatabaseSharedManager)(((IgniteEx)ignite(0))
+ AtomicInteger cntr = ((CheckpointWriteProgressSupplier)(((IgniteEx)ignite(0))
.context().cache().context().database())).writtenPagesCounter();
cpWrittenPages = cntr == null ? 0 : cntr.get();
@@ -161,12 +160,12 @@ public class PagesWriteThrottleSandboxTest extends GridCommonAbstractTest {
e.printStackTrace();
}
- System.out.println("@@@ putsPerSec=," + (putRate.getRate()) + ", getsPerSec=," + (getRate.getRate()) + ", dirtyPages=," + dirtyPages + ", cpWrittenPages=," + cpWrittenPages +", cpBufPages=," + cpBufPages);
+ System.out.println("@@@ putsPerSec=," + (putRate.getRate()) + ", getsPerSec=," + (getRate.getRate()) + ", dirtyPages=," + dirtyPages + ", cpWrittenPages=," + cpWrittenPages + ", cpBufPages=," + cpBufPages);
try {
Thread.sleep(1000);
}
- catch (InterruptedException e) {
+ catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
}
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsUnitTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsUnitTestSuite.java
index c022eea..f68d60c 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsUnitTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsUnitTestSuite.java
@@ -30,7 +30,6 @@ import org.junit.runners.Suite;
@Suite.SuiteClasses({
IgniteThrottlingUnitTest.class,
IgnitePageMemReplaceDelayedWriteUnitTest.class,
- IgniteThrottlingUnitTest.class,
FullPageIdTableTest.class,
RobinHoodBackwardShiftHashMapTest.class
})