You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2018/11/07 14:46:04 UTC
svn commit: r1846037 [2/6] - in /jackrabbit/oak/branches/1.8: ./
oak-store-document/
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/
oak-s...
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java Wed Nov 7 14:46:03 2018
@@ -63,9 +63,6 @@ import java.util.concurrent.atomic.Atomi
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.jcr.PropertyType;
import javax.management.NotCompliantMBeanException;
@@ -125,6 +122,8 @@ import org.apache.jackrabbit.oak.spi.sta
import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
import org.apache.jackrabbit.oak.stats.Clock;
import org.apache.jackrabbit.oak.commons.PerfLogger;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -252,7 +251,7 @@ public final class DocumentNodeStore
/**
* The cluster instance info.
*/
- @Nonnull
+ @NotNull
private final ClusterNodeInfo clusterNodeInfo;
/**
@@ -320,13 +319,13 @@ public final class DocumentNodeStore
/**
* Background thread performing the clusterId lease renew.
*/
- @Nonnull
+ @NotNull
private Thread leaseUpdateThread;
/**
* Background thread performing the cluster update
*/
- @Nonnull
+ @NotNull
private Thread clusterUpdateThread;
/**
@@ -767,7 +766,7 @@ public final class DocumentNodeStore
Revision tombstone = commitQueue.createRevision();
commitQueue.done(tombstone, new CommitQueue.Callback() {
@Override
- public void headOfQueue(@Nonnull Revision revision) {
+ public void headOfQueue(@NotNull Revision revision) {
setRoot(getHeadRevision().update(revision));
unsavedLastRevisions.put(ROOT_PATH, revision);
}
@@ -840,12 +839,12 @@ public final class DocumentNodeStore
return (readOnlyMode?"readOnly:true, ":"") + clusterNodeInfo.toString().replaceAll("[\r\n\t]", " ").trim();
}
- void setRoot(@Nonnull RevisionVector newHead) {
+ void setRoot(@NotNull RevisionVector newHead) {
checkArgument(!newHead.isBranch());
root = getRoot(newHead);
}
- @Nonnull
+ @NotNull
public DocumentStore getDocumentStore() {
return store;
}
@@ -864,7 +863,7 @@ public final class DocumentNodeStore
* free to remove the commits associated with the branch.
* @return a new commit.
*/
- @Nonnull
+ @NotNull
Commit newCommit(@Nullable RevisionVector base,
@Nullable DocumentNodeStoreBranch branch) {
if (base == null) {
@@ -887,7 +886,7 @@ public final class DocumentNodeStore
* @param numBranchCommits the number of branch commits to merge.
* @return a new merge commit.
*/
- @Nonnull
+ @NotNull
MergeCommit newMergeCommit(@Nullable RevisionVector base, int numBranchCommits) {
if (base == null) {
base = getHeadRevision();
@@ -907,14 +906,14 @@ public final class DocumentNodeStore
return c;
}
- RevisionVector done(final @Nonnull Commit c, boolean isBranch, final @Nonnull CommitInfo info) {
+ RevisionVector done(final @NotNull Commit c, boolean isBranch, final @NotNull CommitInfo info) {
if (commitQueue.contains(c.getRevision())) {
try {
inDoubtTrunkCommits.remove(c.getRevision());
final RevisionVector[] newHead = new RevisionVector[1];
commitQueue.done(c.getRevision(), new CommitQueue.Callback() {
@Override
- public void headOfQueue(@Nonnull Revision revision) {
+ public void headOfQueue(@NotNull Revision revision) {
// remember before revision
RevisionVector before = getHeadRevision();
// apply changes to cache based on before revision
@@ -1025,7 +1024,7 @@ public final class DocumentNodeStore
this.journalPushThreshold = journalPushThreshold;
}
- @Nonnull
+ @NotNull
public ClusterNodeInfo getClusterInfo() {
return clusterNodeInfo;
}
@@ -1038,7 +1037,7 @@ public final class DocumentNodeStore
return nodeChildrenCacheStats;
}
- @Nonnull
+ @NotNull
public Iterable<CacheStats> getDiffCacheStats() {
return diffCache.getStats();
}
@@ -1090,10 +1089,10 @@ public final class DocumentNodeStore
splitCandidates.put(id, id);
}
- @CheckForNull
- AbstractDocumentNodeState getSecondaryNodeState(@Nonnull final String path,
- @Nonnull final RevisionVector rootRevision,
- @Nonnull final RevisionVector rev) {
+ @Nullable
+ AbstractDocumentNodeState getSecondaryNodeState(@NotNull final String path,
+ @NotNull final RevisionVector rootRevision,
+ @NotNull final RevisionVector rev) {
//Check secondary cache first
return nodeStateCache.getDocumentNodeState(path, rootRevision, rev);
}
@@ -1111,9 +1110,9 @@ public final class DocumentNodeStore
* @return the node or <code>null</code> if the node does not exist at the
* given revision.
*/
- @CheckForNull
- public DocumentNodeState getNode(@Nonnull final String path,
- @Nonnull final RevisionVector rev) {
+ @Nullable
+ public DocumentNodeState getNode(@NotNull final String path,
+ @NotNull final RevisionVector rev) {
checkNotNull(rev);
checkNotNull(path);
final long start = PERFLOG.start();
@@ -1144,8 +1143,8 @@ public final class DocumentNodeStore
}
}
- @Nonnull
- DocumentNodeState.Children getChildren(@Nonnull final AbstractDocumentNodeState parent,
+ @NotNull
+ DocumentNodeState.Children getChildren(@NotNull final AbstractDocumentNodeState parent,
@Nullable final String name,
final int limit)
throws DocumentStoreException {
@@ -1256,8 +1255,8 @@ public final class DocumentNodeStore
* @param limit the maximum number of child documents to return.
* @return the child documents.
*/
- @Nonnull
- private Iterable<NodeDocument> readChildDocs(@Nonnull final String path,
+ @NotNull
+ private Iterable<NodeDocument> readChildDocs(@NotNull final String path,
@Nullable String name,
final int limit) {
final String to = Utils.getKeyUpperLimit(checkNotNull(path));
@@ -1281,8 +1280,8 @@ public final class DocumentNodeStore
* @param limit the maximum number of child nodes to return.
* @return the child nodes.
*/
- @Nonnull
- Iterable<DocumentNodeState> getChildNodes(@Nonnull final DocumentNodeState parent,
+ @NotNull
+ Iterable<DocumentNodeState> getChildNodes(@NotNull final DocumentNodeState parent,
@Nullable final String name,
final int limit) {
// Preemptive check. If we know there are no children then
@@ -1338,7 +1337,7 @@ public final class DocumentNodeStore
});
}
- @CheckForNull
+ @Nullable
DocumentNodeState readNode(String path, RevisionVector readRevision) {
final long start = PERFLOG.start();
String id = Utils.getIdFromPath(path);
@@ -1483,7 +1482,7 @@ public final class DocumentNodeStore
*
* @param revisions the revisions of the merged branch commits.
*/
- void revisionsMerged(@Nonnull Iterable<Revision> revisions) {
+ void revisionsMerged(@NotNull Iterable<Revision> revisions) {
changes.branchCommit(revisions);
}
@@ -1496,7 +1495,7 @@ public final class DocumentNodeStore
* if the update failed because of a collision.
* @throws DocumentStoreException if the update fails with an error.
*/
- @CheckForNull
+ @Nullable
NodeDocument updateCommitRoot(UpdateOp commit, Revision commitRev)
throws DocumentStoreException {
// use batch commit when there are only revision and modified updates
@@ -1588,8 +1587,8 @@ public final class DocumentNodeStore
* @param revision a revision.
* @return the root node state at the given revision.
*/
- @Nonnull
- DocumentNodeState getRoot(@Nonnull RevisionVector revision) {
+ @NotNull
+ DocumentNodeState getRoot(@NotNull RevisionVector revision) {
DocumentNodeState root = getNode("/", revision);
if (root == null) {
throw new IllegalStateException(
@@ -1598,7 +1597,7 @@ public final class DocumentNodeStore
return root;
}
- @Nonnull
+ @NotNull
DocumentNodeStoreBranch createBranch(DocumentNodeState base) {
DocumentNodeStoreBranch b = DocumentNodeStoreBranch.getCurrentBranch();
if (b != null) {
@@ -1607,9 +1606,9 @@ public final class DocumentNodeStore
return new DocumentNodeStoreBranch(this, base, mergeLock);
}
- @Nonnull
- RevisionVector rebase(@Nonnull RevisionVector branchHead,
- @Nonnull RevisionVector base) {
+ @NotNull
+ RevisionVector rebase(@NotNull RevisionVector branchHead,
+ @NotNull RevisionVector base) {
checkNotNull(branchHead);
checkNotNull(base);
if (disableBranches) {
@@ -1631,9 +1630,9 @@ public final class DocumentNodeStore
return base.update(head);
}
- @Nonnull
- RevisionVector reset(@Nonnull RevisionVector branchHead,
- @Nonnull RevisionVector ancestor) {
+ @NotNull
+ RevisionVector reset(@NotNull RevisionVector branchHead,
+ @NotNull RevisionVector ancestor) {
checkNotNull(branchHead);
checkNotNull(ancestor);
Branch b = getBranches().getBranch(branchHead);
@@ -1686,9 +1685,9 @@ public final class DocumentNodeStore
return ancestor;
}
- @Nonnull
- RevisionVector merge(@Nonnull RevisionVector branchHead,
- @Nonnull CommitInfo info)
+ @NotNull
+ RevisionVector merge(@NotNull RevisionVector branchHead,
+ @NotNull CommitInfo info)
throws CommitFailedException {
Branch b = getBranches().getBranch(branchHead);
RevisionVector base = branchHead;
@@ -1751,9 +1750,9 @@ public final class DocumentNodeStore
* (see the {@link NodeStateDiff} contract for more details)
*/
@Override
- public boolean compare(@Nonnull final AbstractDocumentNodeState node,
- @Nonnull final AbstractDocumentNodeState base,
- @Nonnull NodeStateDiff diff) {
+ public boolean compare(@NotNull final AbstractDocumentNodeState node,
+ @NotNull final AbstractDocumentNodeState base,
+ @NotNull NodeStateDiff diff) {
if (!AbstractNodeState.comparePropertiesAgainstBaseState(node, base, diff)) {
return false;
}
@@ -1777,7 +1776,7 @@ public final class DocumentNodeStore
* @param isBranchCommit whether this is a branch commit.
* @return a _lastRev tracker for the given commit revision.
*/
- LastRevTracker createTracker(final @Nonnull Revision r,
+ LastRevTracker createTracker(final @NotNull Revision r,
final boolean isBranchCommit) {
if (isBranchCommit && !disableBranches) {
Revision branchRev = r.asBranchRevision();
@@ -1801,7 +1800,7 @@ public final class DocumentNodeStore
*
* @param conflictRevisions the revision to become visible.
*/
- void suspendUntilAll(@Nonnull Set<Revision> conflictRevisions) {
+ void suspendUntilAll(@NotNull Set<Revision> conflictRevisions) {
// do not suspend if revision is from another cluster node
// and background read is disabled
if (getAsyncDelay() == 0) {
@@ -1826,34 +1825,34 @@ public final class DocumentNodeStore
//-------------------------< NodeStore >------------------------------------
- @Nonnull
+ @NotNull
@Override
public DocumentNodeState getRoot() {
return root;
}
- @Nonnull
+ @NotNull
@Override
- public NodeState merge(@Nonnull NodeBuilder builder,
- @Nonnull CommitHook commitHook,
- @Nonnull CommitInfo info)
+ public NodeState merge(@NotNull NodeBuilder builder,
+ @NotNull CommitHook commitHook,
+ @NotNull CommitInfo info)
throws CommitFailedException {
return asDocumentRootBuilder(builder).merge(commitHook, info);
}
- @Nonnull
+ @NotNull
@Override
- public NodeState rebase(@Nonnull NodeBuilder builder) {
+ public NodeState rebase(@NotNull NodeBuilder builder) {
return asDocumentRootBuilder(builder).rebase();
}
@Override
- public NodeState reset(@Nonnull NodeBuilder builder) {
+ public NodeState reset(@NotNull NodeBuilder builder) {
return asDocumentRootBuilder(builder).reset();
}
@Override
- @Nonnull
+ @NotNull
public BlobStoreBlob createBlob(InputStream inputStream) throws IOException {
return new BlobStoreBlob(blobStore, blobStore.writeBlob(inputStream));
}
@@ -1866,7 +1865,7 @@ public final class DocumentNodeStore
* @return the blob.
*/
@Override
- public Blob getBlob(@Nonnull String reference) {
+ public Blob getBlob(@NotNull String reference) {
String blobId = blobStore.getBlobId(reference);
if(blobId != null){
return new BlobStoreBlob(blobStore, blobId);
@@ -1885,22 +1884,22 @@ public final class DocumentNodeStore
return new BlobStoreBlob(blobStore, blobId);
}
- @Nonnull
+ @NotNull
@Override
- public String checkpoint(long lifetime, @Nonnull Map<String, String> properties) {
+ public String checkpoint(long lifetime, @NotNull Map<String, String> properties) {
return checkpoints.create(lifetime, properties).toString();
}
- @Nonnull
+ @NotNull
@Override
public String checkpoint(long lifetime) {
Map<String, String> empty = Collections.emptyMap();
return checkpoint(lifetime, empty);
}
- @Nonnull
+ @NotNull
@Override
- public Map<String, String> checkpointInfo(@Nonnull String checkpoint) {
+ public Map<String, String> checkpointInfo(@NotNull String checkpoint) {
Revision r = Revision.fromString(checkpoint);
Checkpoints.Info info = checkpoints.getCheckpoints().get(r);
if (info == null) {
@@ -1911,7 +1910,7 @@ public final class DocumentNodeStore
}
}
- @Nonnull
+ @NotNull
@Override
public Iterable<String> checkpoints() {
final long now = clock.getTime();
@@ -1929,9 +1928,9 @@ public final class DocumentNodeStore
});
}
- @CheckForNull
+ @Nullable
@Override
- public NodeState retrieve(@Nonnull String checkpoint) {
+ public NodeState retrieve(@NotNull String checkpoint) {
RevisionVector rv = getCheckpoints().retrieve(checkpoint);
if (rv == null) {
return null;
@@ -1942,7 +1941,7 @@ public final class DocumentNodeStore
}
@Override
- public boolean release(@Nonnull String checkpoint) {
+ public boolean release(@NotNull String checkpoint) {
checkpoints.release(checkpoint);
return true;
}
@@ -1965,13 +1964,13 @@ public final class DocumentNodeStore
}
@Override
- @Nonnull
+ @NotNull
public RevisionVector getHeadRevision() {
return root.getRootRevision();
}
@Override
- @Nonnull
+ @NotNull
public Revision newRevision() {
if (simpleRevisionCounter != null) {
return new Revision(simpleRevisionCounter.getAndIncrement(), 0, clusterId);
@@ -1980,14 +1979,14 @@ public final class DocumentNodeStore
}
@Override
- @Nonnull
+ @NotNull
public Clock getClock() {
return clock;
}
@Override
- public String getCommitValue(@Nonnull Revision changeRevision,
- @Nonnull NodeDocument doc) {
+ public String getCommitValue(@NotNull Revision changeRevision,
+ @NotNull NodeDocument doc) {
return commitValueResolver.resolve(changeRevision, doc);
}
@@ -2166,7 +2165,7 @@ public final class DocumentNodeStore
* started. The revision is derived from the start time of the
* cluster node.
*/
- @Nonnull
+ @NotNull
private RevisionVector getMinExternalRevisions() {
return new RevisionVector(transform(filter(clusterNodes.values(),
new Predicate<ClusterNodeInfoDocument>() {
@@ -2189,7 +2188,7 @@ public final class DocumentNodeStore
private BackgroundReadStats backgroundRead() {
return new ExternalChange(this) {
@Override
- void invalidateCache(@Nonnull Iterable<String> paths) {
+ void invalidateCache(@NotNull Iterable<String> paths) {
stats.cacheStats = store.invalidateCache(pathToId(paths));
}
@@ -2199,8 +2198,8 @@ public final class DocumentNodeStore
}
@Override
- void updateHead(@Nonnull Set<Revision> externalChanges,
- @Nonnull RevisionVector sweepRevs,
+ void updateHead(@NotNull Set<Revision> externalChanges,
+ @NotNull RevisionVector sweepRevs,
@Nullable Iterable<String> changedPaths) {
long time = clock.getTime();
// make sure no local commit is in progress
@@ -2244,7 +2243,7 @@ public final class DocumentNodeStore
}.process();
}
- private static CommitInfo newCommitInfo(@Nonnull ChangeSet changeSet, JournalPropertyHandler journalPropertyHandler) {
+ private static CommitInfo newCommitInfo(@NotNull ChangeSet changeSet, JournalPropertyHandler journalPropertyHandler) {
CommitContext commitContext = new SimpleCommitContext();
commitContext.set(COMMIT_CONTEXT_OBSERVATION_CHANGESET, changeSet);
journalPropertyHandler.addTo(commitContext);
@@ -2336,12 +2335,12 @@ public final class DocumentNodeStore
}
}
- @Nonnull
+ @NotNull
Set<String> getSplitCandidates() {
return Collections.unmodifiableSet(splitCandidates.keySet());
}
- @Nonnull
+ @NotNull
RevisionVector getSweepRevisions() {
return sweepRevisions;
}
@@ -2446,7 +2445,7 @@ public final class DocumentNodeStore
try {
commitQueue.done(r, new CommitQueue.Callback() {
@Override
- public void headOfQueue(@Nonnull Revision revision) {
+ public void headOfQueue(@NotNull Revision revision) {
writeUpdates(updates, revision);
}
});
@@ -2610,8 +2609,8 @@ public final class DocumentNodeStore
setRoot(headRevision);
}
- @Nonnull
- private Commit newTrunkCommit(@Nonnull RevisionVector base) {
+ @NotNull
+ private Commit newTrunkCommit(@NotNull RevisionVector base) {
checkArgument(!checkNotNull(base).isBranch(),
"base must not be a branch revision: " + base);
@@ -2631,8 +2630,8 @@ public final class DocumentNodeStore
return c;
}
- @Nonnull
- private Commit newBranchCommit(@Nonnull RevisionVector base,
+ @NotNull
+ private Commit newBranchCommit(@NotNull RevisionVector base,
@Nullable DocumentNodeStoreBranch branch) {
checkArgument(checkNotNull(base).isBranch(),
"base must be a branch revision: " + base);
@@ -2920,8 +2919,8 @@ public final class DocumentNodeStore
}
}
- private static PathRev childNodeCacheKey(@Nonnull String path,
- @Nonnull RevisionVector readRevision,
+ private static PathRev childNodeCacheKey(@NotNull String path,
+ @NotNull RevisionVector readRevision,
@Nullable String name) {
String p = (name == null ? "" : name) + path;
return new PathRev(p, readRevision);
@@ -2965,7 +2964,7 @@ public final class DocumentNodeStore
* @param whiteboard
* @return garbage collector of the BlobStore supports GC otherwise null
*/
- @CheckForNull
+ @Nullable
public MarkSweepGarbageCollector createBlobGarbageCollector(long blobGcMaxAgeInSecs, String repositoryId,
Whiteboard whiteboard) {
MarkSweepGarbageCollector blobGC = null;
@@ -3038,7 +3037,7 @@ public final class DocumentNodeStore
this(nodeStore, isDisposed, null);
}
- protected abstract void execute(@Nonnull DocumentNodeStore nodeStore);
+ protected abstract void execute(@NotNull DocumentNodeStore nodeStore);
@Override
public void run() {
@@ -3084,7 +3083,7 @@ public final class DocumentNodeStore
}
@Override
- protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+ protected void execute(@NotNull DocumentNodeStore nodeStore) {
nodeStore.runBackgroundUpdateOperations();
}
}
@@ -3100,7 +3099,7 @@ public final class DocumentNodeStore
}
@Override
- protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+ protected void execute(@NotNull DocumentNodeStore nodeStore) {
nodeStore.runBackgroundReadOperations();
}
}
@@ -3116,7 +3115,7 @@ public final class DocumentNodeStore
}
@Override
- protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+ protected void execute(@NotNull DocumentNodeStore nodeStore) {
nodeStore.backgroundSweep();
}
@@ -3146,7 +3145,7 @@ public final class DocumentNodeStore
}
@Override
- protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+ protected void execute(@NotNull DocumentNodeStore nodeStore) {
// OAK-4859 : keep track of invocation time of renewClusterIdLease
// and warn if time since last call is longer than 5sec
Clock clock = nodeStore.getClock();
@@ -3177,7 +3176,7 @@ public final class DocumentNodeStore
}
@Override
- protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+ protected void execute(@NotNull DocumentNodeStore nodeStore) {
if (nodeStore.updateClusterState()) {
nodeStore.signalClusterStateChange();
}
@@ -3212,17 +3211,17 @@ public final class DocumentNodeStore
return checkpoints;
}
- @Nonnull
+ @NotNull
public VersionGarbageCollector getVersionGarbageCollector() {
return versionGarbageCollector;
}
- @Nonnull
+ @NotNull
public JournalGarbageCollector getJournalGarbageCollector() {
return journalGarbageCollector;
}
- @Nonnull
+ @NotNull
public LastRevRecoveryAgent getLastRevRecoveryAgent() {
return lastRevRecoveryAgent;
}
@@ -3253,7 +3252,7 @@ public final class DocumentNodeStore
}
@Override
- public boolean isVisible(@Nonnull String visibilityToken, long maxWaitMillis) throws InterruptedException {
+ public boolean isVisible(@NotNull String visibilityToken, long maxWaitMillis) throws InterruptedException {
if (Strings.isNullOrEmpty(visibilityToken)) {
// we've asked for @Nonnull..
// hence throwing an exception
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java Wed Nov 7 14:46:03 2018
@@ -32,9 +32,6 @@ import java.util.concurrent.ConcurrentMa
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
@@ -49,6 +46,8 @@ import org.apache.jackrabbit.oak.spi.sta
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
import org.apache.jackrabbit.oak.commons.PerfLogger;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -98,13 +97,13 @@ class DocumentNodeStoreBranch implements
this.updateLimit = store.getUpdateLimit();
}
- @Nonnull
+ @NotNull
@Override
public NodeState getBase() {
return branchState.getBase();
}
- @Nonnull
+ @NotNull
@Override
public NodeState getHead() {
return branchState.getHead();
@@ -115,9 +114,9 @@ class DocumentNodeStoreBranch implements
branchState.setRoot(checkNotNull(newRoot));
}
- @Nonnull
+ @NotNull
@Override
- public NodeState merge(@Nonnull CommitHook hook, @Nonnull CommitInfo info)
+ public NodeState merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
throws CommitFailedException {
try {
return merge0(hook, info, false);
@@ -146,14 +145,14 @@ class DocumentNodeStoreBranch implements
/**
* For test purposes only!
*/
- @Nonnull
+ @NotNull
ReadWriteLock getMergeLock() {
return mergeLock;
}
- @Nonnull
- private NodeState merge0(@Nonnull CommitHook hook,
- @Nonnull CommitInfo info,
+ @NotNull
+ private NodeState merge0(@NotNull CommitHook hook,
+ @NotNull CommitInfo info,
boolean exclusive)
throws CommitFailedException {
CommitFailedException ex = null;
@@ -222,7 +221,7 @@ class DocumentNodeStoreBranch implements
* @throws CommitFailedException if the current thread is interrupted while
* acquiring the lock
*/
- @CheckForNull
+ @Nullable
private Lock acquireMergeLock(boolean exclusive)
throws CommitFailedException {
final long start = perfLogger.start();
@@ -266,9 +265,9 @@ class DocumentNodeStoreBranch implements
* @param info the commit info.
* @return the state with the persisted changes.
*/
- private DocumentNodeState persist(final @Nonnull NodeState toPersist,
- final @Nonnull DocumentNodeState base,
- final @Nonnull CommitInfo info) {
+ private DocumentNodeState persist(final @NotNull NodeState toPersist,
+ final @NotNull DocumentNodeState base,
+ final @NotNull CommitInfo info) {
return persist(new Changes() {
@Override
public void with(Commit c) {
@@ -286,9 +285,9 @@ class DocumentNodeStoreBranch implements
* @param info the commit info.
* @return the result state.
*/
- private DocumentNodeState persist(@Nonnull Changes op,
- @Nonnull DocumentNodeState base,
- @Nonnull CommitInfo info) {
+ private DocumentNodeState persist(@NotNull Changes op,
+ @NotNull DocumentNodeState base,
+ @NotNull CommitInfo info) {
boolean success = false;
Commit c = store.newCommit(base.getRootRevision(), this);
RevisionVector rev;
@@ -329,7 +328,7 @@ class DocumentNodeStoreBranch implements
* See also {@link #withCurrentBranch(Callable)}.
*
*/
- @CheckForNull
+ @Nullable
static DocumentNodeStoreBranch getCurrentBranch() {
return BRANCHES.get(Thread.currentThread());
}
@@ -360,7 +359,7 @@ class DocumentNodeStoreBranch implements
return base;
}
- @Nonnull
+ @NotNull
abstract NodeState getHead();
abstract void setRoot(NodeState root);
@@ -387,9 +386,9 @@ class DocumentNodeStoreBranch implements
* use the appropriate type in {@code CommitFailedException} to
* indicate the cause of the exception.
*/
- @Nonnull
- abstract NodeState merge(@Nonnull CommitHook hook,
- @Nonnull CommitInfo info,
+ @NotNull
+ abstract NodeState merge(@NotNull CommitHook hook,
+ @NotNull CommitInfo info,
boolean exclusive)
throws CommitFailedException;
}
@@ -415,7 +414,7 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
+ @NotNull
NodeState getHead() {
return base;
}
@@ -433,9 +432,9 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
- NodeState merge(@Nonnull CommitHook hook,
- @Nonnull CommitInfo info,
+ @NotNull
+ NodeState merge(@NotNull CommitHook hook,
+ @NotNull CommitInfo info,
boolean exclusive) {
branchState = new Merged(base);
return base;
@@ -474,7 +473,7 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
+ @NotNull
NodeState getHead() {
return head;
}
@@ -502,9 +501,9 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
- NodeState merge(@Nonnull CommitHook hook,
- @Nonnull CommitInfo info,
+ @NotNull
+ NodeState merge(@NotNull CommitHook hook,
+ @NotNull CommitInfo info,
boolean exclusive)
throws CommitFailedException {
checkNotNull(hook);
@@ -574,7 +573,7 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
+ @NotNull
NodeState getHead() {
return head;
}
@@ -595,9 +594,9 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
- NodeState merge(@Nonnull final CommitHook hook,
- @Nonnull final CommitInfo info,
+ @NotNull
+ NodeState merge(@NotNull final CommitHook hook,
+ @NotNull final CommitInfo info,
boolean exclusive)
throws CommitFailedException {
boolean success = false;
@@ -700,7 +699,7 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
+ @NotNull
NodeState getHead() {
throw new IllegalStateException("Branch has already been merged");
}
@@ -716,9 +715,9 @@ class DocumentNodeStoreBranch implements
}
@Override
- @Nonnull
- NodeState merge(@Nonnull CommitHook hook,
- @Nonnull CommitInfo info,
+ @NotNull
+ NodeState merge(@NotNull CommitHook hook,
+ @NotNull CommitInfo info,
boolean exclusive) {
throw new IllegalStateException("Branch has already been merged");
}
@@ -742,7 +741,7 @@ class DocumentNodeStoreBranch implements
this.ex = e;
}
- @Nonnull
+ @NotNull
@Override
NodeState getHead() {
throw new IllegalStateException("Branch with failed reset", ex);
@@ -764,10 +763,10 @@ class DocumentNodeStoreBranch implements
*
* @throws CommitFailedException the exception of the failed reset.
*/
- @Nonnull
+ @NotNull
@Override
- NodeState merge(@Nonnull CommitHook hook,
- @Nonnull CommitInfo info,
+ NodeState merge(@NotNull CommitHook hook,
+ @NotNull CommitInfo info,
boolean exclusive)
throws CommitFailedException {
throw ex;
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java Wed Nov 7 14:46:03 2018
@@ -22,9 +22,6 @@ import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.Executor;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.base.Supplier;
@@ -60,6 +57,8 @@ import org.apache.jackrabbit.oak.spi.gc.
import org.apache.jackrabbit.oak.spi.gc.LoggingGCMonitor;
import org.apache.jackrabbit.oak.stats.Clock;
import org.apache.jackrabbit.oak.stats.StatisticsProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -457,17 +456,17 @@ public class DocumentNodeStoreBuilder<T
return thisBuilder();
}
- @Nonnull
+ @NotNull
public Map<CacheType, PersistentCacheStats> getPersistenceCacheStats() {
return persistentCacheStats;
}
- @CheckForNull
+ @Nullable
public BlobStoreStats getBlobStoreStats() {
return blobStoreStats;
}
- @CheckForNull
+ @Nullable
public CacheStats getBlobStoreCacheStats() {
return blobStoreCacheStats;
}
@@ -545,7 +544,7 @@ public class DocumentNodeStoreBuilder<T
return maxRevisionAgeMillis;
}
- public T setGCMonitor(@Nonnull GCMonitor gcMonitor) {
+ public T setGCMonitor(@NotNull GCMonitor gcMonitor) {
this.gcMonitor = checkNotNull(gcMonitor);
return thisBuilder();
}
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java Wed Nov 7 14:46:03 2018
@@ -46,7 +46,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
-import javax.annotation.Nonnull;
import javax.sql.DataSource;
import com.google.common.base.Predicate;
@@ -105,6 +104,7 @@ import org.apache.jackrabbit.oak.spi.whi
import org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardExecutor;
import org.apache.jackrabbit.oak.stats.StatisticsProvider;
import org.apache.jackrabbit.oak.spi.descriptors.GenericDescriptors;
+import org.jetbrains.annotations.NotNull;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
@@ -863,11 +863,11 @@ public class DocumentNodeStoreService {
return result;
}
- private void addRegistration(@Nonnull Registration reg) {
+ private void addRegistration(@NotNull Registration reg) {
closer.register(asCloseable(reg));
}
- private static Closeable asCloseable(@Nonnull final Registration reg) {
+ private static Closeable asCloseable(@NotNull final Registration reg) {
checkNotNull(reg);
return new Closeable() {
@Override
@@ -877,7 +877,7 @@ public class DocumentNodeStoreService {
};
}
- private static Closeable asCloseable(@Nonnull final AbstractServiceTracker t) {
+ private static Closeable asCloseable(@NotNull final AbstractServiceTracker t) {
checkNotNull(t);
return new Closeable() {
@Override
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java Wed Nov 7 14:46:03 2018
@@ -21,7 +21,6 @@ import static org.apache.jackrabbit.oak.
import java.util.List;
-import javax.annotation.Nonnull;
import javax.jcr.PropertyType;
import com.google.common.collect.Lists;
@@ -38,6 +37,7 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
import org.apache.jackrabbit.oak.plugins.memory.StringPropertyState;
import org.apache.jackrabbit.oak.plugins.value.Conversions;
+import org.jetbrains.annotations.NotNull;
/**
* PropertyState implementation with lazy parsing of the JSOP encoded value.
@@ -58,7 +58,7 @@ final class DocumentPropertyState implem
this.value = value;
}
- @Nonnull
+ @NotNull
@Override
public String getName() {
return name;
@@ -74,13 +74,13 @@ final class DocumentPropertyState implem
return parsed().getType();
}
- @Nonnull
+ @NotNull
@Override
public <T> T getValue(Type<T> type) {
return parsed().getValue(type);
}
- @Nonnull
+ @NotNull
@Override
public <T> T getValue(Type<T> type, int index) {
return parsed().getValue(type, index);
@@ -114,7 +114,7 @@ final class DocumentPropertyState implem
*
* @return the raw un-parsed value.
*/
- @Nonnull
+ @NotNull
String getValue() {
return value;
}
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java Wed Nov 7 14:46:03 2018
@@ -21,14 +21,13 @@ import static com.google.common.base.Pre
import java.io.IOException;
import java.io.InputStream;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.api.Blob;
import org.apache.jackrabbit.oak.api.CommitFailedException;
import org.apache.jackrabbit.oak.spi.commit.CommitHook;
import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,7 +50,7 @@ class DocumentRootBuilder extends Abstra
* This differs from the base state of super since the latter one reflects
* the base created by the last purge.
*/
- @Nonnull
+ @NotNull
private NodeState base;
/**
@@ -70,8 +69,8 @@ class DocumentRootBuilder extends Abstra
*/
private int updates;
- DocumentRootBuilder(@Nonnull DocumentNodeState base,
- @Nonnull DocumentNodeStore store) {
+ DocumentRootBuilder(@NotNull DocumentNodeState base,
+ @NotNull DocumentNodeStore store) {
super(checkNotNull(base));
this.store = checkNotNull(store);
this.base = base;
@@ -82,13 +81,13 @@ class DocumentRootBuilder extends Abstra
//--------------------------------------------------< MemoryNodeBuilder >---
- @Override @Nonnull
+ @Override @NotNull
public NodeState getBaseState() {
return base;
}
@Override
- public void reset(@Nonnull NodeState newBase) {
+ public void reset(@NotNull NodeState newBase) {
base = checkNotNull(newBase);
super.reset(newBase);
}
@@ -105,7 +104,7 @@ class DocumentRootBuilder extends Abstra
}
}
- @Nonnull
+ @NotNull
@Override
public NodeState getNodeState() {
if (DocumentNodeStoreBranch.getCurrentBranch() != null) {
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java Wed Nov 7 14:46:03 2018
@@ -19,12 +19,11 @@ package org.apache.jackrabbit.oak.plugin
import java.util.List;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.cache.CacheStats;
import org.apache.jackrabbit.oak.plugins.document.UpdateOp.Condition;
import org.apache.jackrabbit.oak.plugins.document.cache.CacheInvalidationStats;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* The interface for the backend storage for documents.
@@ -56,7 +55,7 @@ public interface DocumentStore {
* @throws DocumentStoreException if the operation failed. E.g. because of
* an I/O error.
*/
- @CheckForNull
+ @Nullable
<T extends Document> T find(Collection<T> collection, String key)
throws DocumentStoreException;
@@ -78,7 +77,7 @@ public interface DocumentStore {
* @throws DocumentStoreException if the operation failed. E.g. because of
* an I/O error.
*/
- @CheckForNull
+ @Nullable
<T extends Document> T find(Collection<T> collection, String key, int maxCacheAge)
throws DocumentStoreException;
@@ -97,7 +96,7 @@ public interface DocumentStore {
* @throws DocumentStoreException if the operation failed. E.g. because of
* an I/O error.
*/
- @Nonnull
+ @NotNull
<T extends Document> List<T> query(Collection<T> collection,
String fromKey,
String toKey,
@@ -125,7 +124,7 @@ public interface DocumentStore {
* @throws DocumentStoreException if the operation failed. E.g. because of
* an I/O error.
*/
- @Nonnull
+ @NotNull
<T extends Document> List<T> query(Collection<T> collection,
String fromKey,
String toKey,
@@ -276,7 +275,7 @@ public interface DocumentStore {
* @throws DocumentStoreException if the operation failed. E.g. because of
* an I/O error.
*/
- @CheckForNull
+ @Nullable
<T extends Document> T createOrUpdate(Collection<T> collection,
UpdateOp update)
throws IllegalArgumentException, DocumentStoreException;
@@ -329,7 +328,7 @@ public interface DocumentStore {
* @throws DocumentStoreException if the operation failed. E.g. because of
* an I/O error.
*/
- @CheckForNull
+ @Nullable
<T extends Document> T findAndUpdate(Collection<T> collection,
UpdateOp update)
throws DocumentStoreException;
@@ -355,7 +354,7 @@ public interface DocumentStore {
* @return cache invalidation statistics or {@code null} if none are
* available.
*/
- @CheckForNull
+ @Nullable
CacheInvalidationStats invalidateCache();
/**
@@ -369,7 +368,7 @@ public interface DocumentStore {
* @return cache invalidation statistics or {@code null} if none are
* available.
*/
- @CheckForNull
+ @Nullable
CacheInvalidationStats invalidateCache(Iterable<String> keys);
/**
@@ -400,7 +399,7 @@ public interface DocumentStore {
* @param key the key
* @return cached document if present. Otherwise {@code null}.
*/
- @CheckForNull
+ @Nullable
<T extends Document> T getIfCached(Collection<T> collection, String key);
/**
@@ -413,7 +412,7 @@ public interface DocumentStore {
/**
* @return status information about the cache
*/
- @CheckForNull
+ @Nullable
Iterable<CacheStats> getCacheStats();
/**
@@ -431,7 +430,7 @@ public interface DocumentStore {
*
* @return statistics about this document store.
*/
- @Nonnull
+ @NotNull
Map<String, String> getStats();
/**
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java Wed Nov 7 14:46:03 2018
@@ -20,14 +20,13 @@ import java.io.IOException;
import java.util.Map;
import java.util.Set;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.commons.sort.StringSort;
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
import org.apache.jackrabbit.oak.spi.observation.ChangeSetBuilder;
import org.apache.jackrabbit.oak.stats.Clock;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,7 +65,7 @@ abstract class ExternalChange {
*
* @param paths the paths of affected nodes.
*/
- abstract void invalidateCache(@Nonnull Iterable<String> paths);
+ abstract void invalidateCache(@NotNull Iterable<String> paths);
/**
* Called when all cache entries must be invalidated.
@@ -83,8 +82,8 @@ abstract class ExternalChange {
* @param changedPaths paths of nodes that are affected by those external
* changes.
*/
- abstract void updateHead(@Nonnull Set<Revision> externalChanges,
- @Nonnull RevisionVector sweepRevisions,
+ abstract void updateHead(@NotNull Set<Revision> externalChanges,
+ @NotNull RevisionVector sweepRevisions,
@Nullable Iterable<String> changedPaths);
/**
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java Wed Nov 7 14:46:03 2018
@@ -16,9 +16,8 @@
*/
package org.apache.jackrabbit.oak.plugins.document;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.jetbrains.annotations.NotNull;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -33,9 +32,9 @@ class FailedWithConflictException extend
private final Set<Revision> conflictRevisions;
- FailedWithConflictException(@Nonnull Set<Revision> conflictRevisions,
- @Nonnull String message,
- @Nonnull Throwable cause) {
+ FailedWithConflictException(@NotNull Set<Revision> conflictRevisions,
+ @NotNull String message,
+ @NotNull Throwable cause) {
super(OAK, MERGE, 4, checkNotNull(message), checkNotNull(cause));
this.conflictRevisions = checkNotNull(conflictRevisions);
}
@@ -43,8 +42,8 @@ class FailedWithConflictException extend
/**
* @return the revision of another commit which caused a conflict.
*/
- @Nonnull
+ @NotNull
Set<Revision> getConflictRevisions() {
return conflictRevisions;
}
-}
\ No newline at end of file
+}
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java Wed Nov 7 14:46:03 2018
@@ -18,8 +18,6 @@ package org.apache.jackrabbit.oak.plugin
import java.util.List;
-import javax.annotation.Nonnull;
-
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
@@ -27,6 +25,8 @@ import com.google.common.collect.Lists;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.jackrabbit.oak.plugins.document.Collection.SETTINGS;
+import org.jetbrains.annotations.NotNull;
+
/**
* The format version currently in use by the DocumentNodeStore and written
* to the underlying DocumentStore. A version {@link #canRead} the current or
@@ -135,8 +135,8 @@ public final class FormatVersion impleme
* @throws DocumentStoreException if an error occurs while reading from the
* store.
*/
- @Nonnull
- public static FormatVersion versionOf(@Nonnull DocumentStore store)
+ @NotNull
+ public static FormatVersion versionOf(@NotNull DocumentStore store)
throws DocumentStoreException {
checkNotNull(store);
FormatVersion v = V0;
@@ -175,7 +175,7 @@ public final class FormatVersion impleme
* are active cluster nodes using an existing version, 3) the version
* was changed concurrently.
*/
- public boolean writeTo(@Nonnull DocumentStore store)
+ public boolean writeTo(@NotNull DocumentStore store)
throws DocumentStoreException {
checkNotNull(store);
FormatVersion v = versionOf(store);
@@ -258,7 +258,7 @@ public final class FormatVersion impleme
}
@Override
- public int compareTo(@Nonnull FormatVersion other) {
+ public int compareTo(@NotNull FormatVersion other) {
checkNotNull(other);
return ComparisonChain.start()
.compare(major, other.major)
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java Wed Nov 7 14:46:03 2018
@@ -20,16 +20,14 @@ import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import com.google.common.base.Stopwatch;
import org.apache.jackrabbit.oak.cache.CacheStats;
import org.apache.jackrabbit.oak.commons.sort.StringSort;
import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,9 +52,9 @@ class JournalDiffLoader implements DiffC
private Stats stats;
- JournalDiffLoader(@Nonnull AbstractDocumentNodeState base,
- @Nonnull AbstractDocumentNodeState node,
- @Nonnull DocumentNodeStore ns) {
+ JournalDiffLoader(@NotNull AbstractDocumentNodeState base,
+ @NotNull AbstractDocumentNodeState node,
+ @NotNull DocumentNodeStore ns) {
this.base = checkNotNull(base);
this.node = checkNotNull(node);
this.ns = checkNotNull(ns);
@@ -181,7 +179,7 @@ class JournalDiffLoader implements DiffC
}
}
- @Nonnull
+ @NotNull
private RevisionVector getBaseRevision(RevisionVector rv) {
if (!rv.isBranch()) {
return rv;
@@ -256,29 +254,29 @@ class JournalDiffLoader implements DiffC
this.stats = stats;
}
- @CheckForNull
+ @Nullable
String getChanges() {
return changes;
}
@Override
- String getChanges(@Nonnull RevisionVector from,
- @Nonnull RevisionVector to,
- @Nonnull String path,
+ String getChanges(@NotNull RevisionVector from,
+ @NotNull RevisionVector to,
+ @NotNull String path,
@Nullable Loader loader) {
return cache.getChanges(from, to, path, loader);
}
- @Nonnull
+ @NotNull
@Override
- Entry newEntry(@Nonnull final RevisionVector from,
- @Nonnull final RevisionVector to,
+ Entry newEntry(@NotNull final RevisionVector from,
+ @NotNull final RevisionVector to,
boolean local) {
final Entry entry = cache.newEntry(from, to, local);
return new Entry() {
@Override
- public void append(@Nonnull String path,
- @Nonnull String changes) {
+ public void append(@NotNull String path,
+ @NotNull String changes) {
trackStats(path, from, to, changes);
entry.append(path, changes);
if (path.equals(WrappedDiffCache.this.path)) {
@@ -304,7 +302,7 @@ class JournalDiffLoader implements DiffC
stats.valueMemory += new StringValue(changes).getMemory();
}
- @Nonnull
+ @NotNull
@Override
Iterable<CacheStats> getStats() {
return cache.getStats();
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java Wed Nov 7 14:46:03 2018
@@ -24,10 +24,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -41,6 +37,8 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
import org.apache.jackrabbit.oak.spi.observation.ChangeSet;
import org.apache.jackrabbit.oak.spi.observation.ChangeSetBuilder;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -127,11 +125,11 @@ public final class JournalEntry extends
});
}
- static void applyTo(@Nonnull Iterable<String> changedPaths,
- @Nonnull DiffCache diffCache,
- @Nonnull String path,
- @Nonnull RevisionVector from,
- @Nonnull RevisionVector to) throws IOException {
+ static void applyTo(@NotNull Iterable<String> changedPaths,
+ @NotNull DiffCache diffCache,
+ @NotNull String path,
+ @NotNull RevisionVector from,
+ @NotNull RevisionVector to) throws IOException {
LOG.debug("applyTo: starting for {} from {} to {}", path, from, to);
// note that it is not de-duplicated yet
LOG.debug("applyTo: sorting done.");
@@ -233,11 +231,11 @@ public final class JournalEntry extends
* @throws IOException if adding external changes to the {@code StringSort}
* instances fails with an exception.
*/
- static int fillExternalChanges(@Nonnull StringSort externalChanges,
- @Nonnull StringSort invalidate,
- @Nonnull Revision from,
- @Nonnull Revision to,
- @Nonnull DocumentStore store)
+ static int fillExternalChanges(@NotNull StringSort externalChanges,
+ @NotNull StringSort invalidate,
+ @NotNull Revision from,
+ @NotNull Revision to,
+ @NotNull DocumentStore store)
throws IOException {
return fillExternalChanges(externalChanges, invalidate, ROOT_PATH,
from, to, store, null, null);
@@ -268,12 +266,12 @@ public final class JournalEntry extends
* @throws IOException if adding external changes to the {@code StringSort}
* instances fails with an exception.
*/
- static int fillExternalChanges(@Nonnull StringSort externalChanges,
- @Nonnull StringSort invalidate,
- @Nonnull String path,
- @Nonnull Revision from,
- @Nonnull Revision to,
- @Nonnull DocumentStore store,
+ static int fillExternalChanges(@NotNull StringSort externalChanges,
+ @NotNull StringSort invalidate,
+ @NotNull String path,
+ @NotNull Revision from,
+ @NotNull Revision to,
+ @NotNull DocumentStore store,
@Nullable ChangeSetBuilder changeSetBuilder,
@Nullable JournalPropertyHandler journalPropertyHandler)
throws IOException {
@@ -339,9 +337,9 @@ public final class JournalEntry extends
return numEntries;
}
- private static void fillFromJournalEntry(@Nonnull StringSort externalChanges,
- @Nonnull StringSort invalidate,
- @Nonnull String path,
+ private static void fillFromJournalEntry(@NotNull StringSort externalChanges,
+ @NotNull StringSort invalidate,
+ @NotNull String path,
@Nullable ChangeSetBuilder changeSetBuilder,
@Nullable JournalPropertyHandler journalPropertyHandler,
JournalEntry d) throws IOException {
@@ -410,7 +408,7 @@ public final class JournalEntry extends
changeSetBuilder.add(set);
}
- void branchCommit(@Nonnull Iterable<Revision> revisions) {
+ void branchCommit(@NotNull Iterable<Revision> revisions) {
if (!revisions.iterator().hasNext()) {
return;
}
@@ -428,7 +426,7 @@ public final class JournalEntry extends
put(BRANCH_COMMITS, branchCommits);
}
- UpdateOp asUpdateOp(@Nonnull Revision revision) {
+ UpdateOp asUpdateOp(@NotNull Revision revision) {
String id = asId(revision);
UpdateOp op = new UpdateOp(id, true);
op.set(CHANGES, getChanges().serialize());
@@ -461,7 +459,7 @@ public final class JournalEntry extends
*
* @param revisions the references to invalidate-only journal entries.
*/
- void invalidate(@Nonnull Iterable<Revision> revisions) {
+ void invalidate(@NotNull Iterable<Revision> revisions) {
String value = (String) get(INVALIDATE_ONLY);
if (value == null) {
value = "";
@@ -508,7 +506,7 @@ public final class JournalEntry extends
*
* @return the branch commits.
*/
- @Nonnull
+ @NotNull
Iterable<JournalEntry> getBranchCommits() {
return getLinkedEntries(BRANCH_COMMITS);
}
@@ -548,7 +546,7 @@ public final class JournalEntry extends
*
* @return the invalidate-only entries.
*/
- @Nonnull
+ @NotNull
private Iterable<JournalEntry> getInvalidateOnly() {
return getLinkedEntries(INVALIDATE_ONLY);
}
@@ -598,7 +596,7 @@ public final class JournalEntry extends
return builder.toString();
}
- static String asId(@Nonnull Revision revision) {
+ static String asId(@NotNull Revision revision) {
checkNotNull(revision);
String s = String.format(REVISION_FORMAT, revision.getClusterId(), revision.getTimestamp(), revision.getCounter());
if (revision.isBranch()) {
@@ -607,7 +605,7 @@ public final class JournalEntry extends
return s;
}
- @CheckForNull
+ @Nullable
private TreeNode getNode(String path) {
TreeNode node = getChanges();
for (String name : PathUtils.elements(path)) {
@@ -619,7 +617,7 @@ public final class JournalEntry extends
return node;
}
- @Nonnull
+ @NotNull
private TreeNode getChanges() {
if (changes == null) {
TreeNode node = new TreeNode(concurrent);
@@ -678,7 +676,7 @@ public final class JournalEntry extends
return false;
}
- @Nonnull
+ @NotNull
private TreeNode getRoot() {
TreeNode n = this;
while (n.parent != null) {
@@ -726,12 +724,12 @@ public final class JournalEntry extends
return builder.toString();
}
- @Nonnull
+ @NotNull
Set<String> keySet() {
return children.keySet();
}
- @CheckForNull
+ @Nullable
TreeNode get(String name) {
return children.get(name);
}
@@ -752,7 +750,7 @@ public final class JournalEntry extends
}
}
- @Nonnull
+ @NotNull
private TreeNode getOrCreate(String name) {
if (children == NO_CHILDREN) {
children = mapFactory.newMap();
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java Wed Nov 7 14:46:03 2018
@@ -16,11 +16,10 @@
*/
package org.apache.jackrabbit.oak.plugins.document;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.spi.state.AbstractNodeState;
import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
+import org.jetbrains.annotations.NotNull;
/**
* A {@link NodeStateDiffer} implementation backed by a JSOP String.
@@ -40,9 +39,9 @@ class JsopNodeStateDiffer implements Nod
}
@Override
- public boolean compare(@Nonnull final AbstractDocumentNodeState node,
- @Nonnull final AbstractDocumentNodeState base,
- @Nonnull final NodeStateDiff diff) {
+ public boolean compare(@NotNull final AbstractDocumentNodeState node,
+ @NotNull final AbstractDocumentNodeState base,
+ @NotNull final NodeStateDiff diff) {
if (!withoutPropertyChanges) {
if (!AbstractNodeState.comparePropertiesAgainstBaseState(node, base, diff)) {
return false;
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java Wed Nov 7 14:46:03 2018
@@ -34,9 +34,6 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReentrantLock;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
@@ -47,6 +44,8 @@ import org.apache.jackrabbit.oak.commons
import org.apache.jackrabbit.oak.plugins.document.util.MapFactory;
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
import org.apache.jackrabbit.oak.stats.Clock;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -464,7 +463,7 @@ public class LastRevRecoveryAgent {
* @return the commit revision of the last modification by {@code clusterId}
* to the given document.
*/
- @CheckForNull
+ @Nullable
private Revision determineLastModification(NodeDocument doc, int clusterId) {
ClusterPredicate cp = new ClusterPredicate(clusterId);
@@ -583,27 +582,27 @@ public class LastRevRecoveryAgent {
return clusterId;
}
- @Nonnull
+ @NotNull
@Override
public RevisionVector getHeadRevision() {
return new RevisionVector(root.getLastRev().values());
}
- @Nonnull
+ @NotNull
@Override
public Revision newRevision() {
return Revision.newRevision(clusterId);
}
- @Nonnull
+ @NotNull
@Override
public Clock getClock() {
return context.getClock();
}
@Override
- public String getCommitValue(@Nonnull Revision changeRevision,
- @Nonnull NodeDocument doc) {
+ public String getCommitValue(@NotNull Revision changeRevision,
+ @NotNull NodeDocument doc) {
return context.getCommitValue(changeRevision, doc);
}
}
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java Wed Nov 7 14:46:03 2018
@@ -21,11 +21,9 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Helper class to track when a node was last modified.
@@ -73,7 +71,7 @@ final class LastRevs implements Iterable
}
}
- @CheckForNull
+ @Nullable
Revision getBranchRevision() {
return branchRev;
}
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java Wed Nov 7 14:46:03 2018
@@ -19,9 +19,6 @@ package org.apache.jackrabbit.oak.plugin
import java.util.Collections;
import java.util.Map;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import com.google.common.cache.Cache;
import com.google.common.collect.Maps;
@@ -32,6 +29,8 @@ import org.apache.jackrabbit.oak.commons
import org.apache.jackrabbit.oak.commons.json.JsopTokenizer;
import org.apache.jackrabbit.oak.plugins.document.util.RevisionsKey;
import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -57,9 +56,9 @@ public class LocalDiffCache extends Diff
}
@Override
- public String getChanges(@Nonnull RevisionVector from,
- @Nonnull RevisionVector to,
- @Nonnull String path,
+ public String getChanges(@NotNull RevisionVector from,
+ @NotNull RevisionVector to,
+ @NotNull String path,
@Nullable Loader loader) {
RevisionsKey key = new RevisionsKey(from, to);
Diff diff = diffCache.getIfPresent(key);
@@ -73,16 +72,16 @@ public class LocalDiffCache extends Diff
return null;
}
- @Nonnull
+ @NotNull
@Override
- public Entry newEntry(final @Nonnull RevisionVector from,
- final @Nonnull RevisionVector to,
+ public Entry newEntry(final @NotNull RevisionVector from,
+ final @NotNull RevisionVector to,
boolean local /*ignored*/) {
return new Entry() {
private final Map<String, String> changesPerPath = Maps.newHashMap();
private long size;
@Override
- public void append(@Nonnull String path, @Nonnull String changes) {
+ public void append(@NotNull String path, @NotNull String changes) {
if (exceedsSize()){
return;
}
@@ -107,7 +106,7 @@ public class LocalDiffCache extends Diff
};
}
- @Nonnull
+ @NotNull
@Override
public Iterable<CacheStats> getStats() {
return Collections.singleton(diffCacheStats);
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java Wed Nov 7 14:46:03 2018
@@ -20,12 +20,10 @@ import java.util.Collections;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import org.apache.jackrabbit.oak.cache.CacheStats;
import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import com.google.common.cache.Cache;
import org.slf4j.Logger;
@@ -65,11 +63,11 @@ public class MemoryDiffCache extends Dif
builder.getWeigher(), builder.getMemoryDiffCacheSize());
}
- @CheckForNull
+ @Nullable
@Override
- public String getChanges(@Nonnull final RevisionVector from,
- @Nonnull final RevisionVector to,
- @Nonnull final String path,
+ public String getChanges(@NotNull final RevisionVector from,
+ @NotNull final RevisionVector to,
+ @NotNull final String path,
@Nullable final Loader loader) {
PathRev key = diffCacheKey(path, from, to);
StringValue diff;
@@ -98,15 +96,15 @@ public class MemoryDiffCache extends Dif
return diff != null ? diff.toString() : null;
}
- @Nonnull
+ @NotNull
@Override
- public Entry newEntry(@Nonnull RevisionVector from,
- @Nonnull RevisionVector to,
+ public Entry newEntry(@NotNull RevisionVector from,
+ @NotNull RevisionVector to,
boolean local /*ignored*/) {
return new MemoryEntry(from, to);
}
- @Nonnull
+ @NotNull
@Override
public Iterable<CacheStats> getStats() {
return Collections.singleton(diffCacheStats);
@@ -123,7 +121,7 @@ public class MemoryDiffCache extends Dif
}
@Override
- public void append(@Nonnull String path, @Nonnull String changes) {
+ public void append(@NotNull String path, @NotNull String changes) {
PathRev key = diffCacheKey(path, from, to);
if (changes.length() > CACHE_VALUE_LIMIT) {
LOG.warn("Not caching entry for {} from {} to {}. Length of changes is {}.",
@@ -140,9 +138,9 @@ public class MemoryDiffCache extends Dif
}
}
- private static PathRev diffCacheKey(@Nonnull String path,
- @Nonnull RevisionVector from,
- @Nonnull RevisionVector to) {
+ private static PathRev diffCacheKey(@NotNull String path,
+ @NotNull RevisionVector from,
+ @NotNull RevisionVector to) {
return new PathRev(from + path, to);
}
@@ -159,17 +157,17 @@ public class MemoryDiffCache extends Dif
* @return {@code true} if there are cache entries that indicate the node
* at the given path was modified between the two revisions.
*/
- private boolean isUnchanged(@Nonnull final RevisionVector from,
- @Nonnull final RevisionVector to,
- @Nonnull final String path) {
+ private boolean isUnchanged(@NotNull final RevisionVector from,
+ @NotNull final RevisionVector to,
+ @NotNull final String path) {
return !denotesRoot(path)
&& isChildUnchanged(from, to, getParentPath(path), getName(path));
}
- private boolean isChildUnchanged(@Nonnull final RevisionVector from,
- @Nonnull final RevisionVector to,
- @Nonnull final String parent,
- @Nonnull final String name) {
+ private boolean isChildUnchanged(@NotNull final RevisionVector from,
+ @NotNull final RevisionVector to,
+ @NotNull final String parent,
+ @NotNull final String name) {
PathRev parentKey = diffCacheKey(parent, from, to);
StringValue parentCachedEntry = diffCache.getIfPresent(parentKey);
boolean unchanged;
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java Wed Nov 7 14:46:03 2018
@@ -19,10 +19,10 @@ package org.apache.jackrabbit.oak.plugin
import java.util.Set;
import java.util.SortedSet;
-import javax.annotation.Nonnull;
-
import com.google.common.collect.Sets;
+import org.jetbrains.annotations.NotNull;
+
/**
* A merge commit containing multiple commit revisions. One for each branch
* commit to merge.
@@ -43,7 +43,7 @@ class MergeCommit extends Commit {
return mergeRevs;
}
- void addBranchCommits(@Nonnull Branch branch) {
+ void addBranchCommits(@NotNull Branch branch) {
for (Revision r : branch.getCommits()) {
if (!branch.getCommit(r).isRebase()) {
branchCommits.add(r);
Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java?rev=1846037&r1=1846036&r2=1846037&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java (original)
+++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java Wed Nov 7 14:46:03 2018
@@ -19,12 +19,11 @@
package org.apache.jackrabbit.oak.plugins.document;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfo.RecoverLockState;
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
import org.apache.jackrabbit.oak.stats.Clock;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -73,7 +72,7 @@ public class MissingLastRevSeeker {
*
* @return the clusters
*/
- @Nonnull
+ @NotNull
public Iterable<ClusterNodeInfoDocument> getAllClusters() {
return ClusterNodeInfoDocument.all(store);
}
@@ -84,7 +83,7 @@ public class MissingLastRevSeeker {
* @param clusterId the cluster id
* @return the cluster node info
*/
- @CheckForNull
+ @Nullable
public ClusterNodeInfoDocument getClusterNodeInfo(final int clusterId) {
// Fetch all documents.
return store.find(CLUSTER_NODES, String.valueOf(clusterId));
@@ -97,7 +96,7 @@ public class MissingLastRevSeeker {
* @param startTime the start time in milliseconds.
* @return the candidates
*/
- @Nonnull
+ @NotNull
public Iterable<NodeDocument> getCandidates(final long startTime) {
// Fetch all documents where lastmod >= startTime
Iterable<NodeDocument> nodes = getSelectedDocuments(store,
@@ -183,7 +182,7 @@ public class MissingLastRevSeeker {
* Check if _lastRev recovery needed for this cluster node
* state is Active and currentTime past the leaseEnd time
*/
- public boolean isRecoveryNeeded(@Nonnull ClusterNodeInfoDocument nodeInfo) {
+ public boolean isRecoveryNeeded(@NotNull ClusterNodeInfoDocument nodeInfo) {
return nodeInfo.isActive() && clock.getTime() > nodeInfo.getLeaseEndTime();
}