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/07/18 15:02:29 UTC
svn commit: r1836191 [3/5] - in /jackrabbit/oak/trunk/oak-segment-tar: ./
src/main/java/org/apache/jackrabbit/oak/backup/impl/
src/main/java/org/apache/jackrabbit/oak/segment/
src/main/java/org/apache/jackrabbit/oak/segment/compaction/
src/main/java/or...
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentTracker.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentTracker.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentTracker.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentTracker.java Wed Jul 18 15:02:27 2018
@@ -26,7 +26,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* Tracker of references to segment identifiers and segment instances
@@ -47,7 +47,7 @@ public class SegmentTracker implements S
/**
* The random number source for generating new segment identifiers.
*/
- @Nonnull
+ @NotNull
private final SecureRandom random = new SecureRandom();
/**
@@ -59,19 +59,19 @@ public class SegmentTracker implements S
* (when there are no matching identifiers) or a list of weak references
* to the matching identifiers.
*/
- @Nonnull
+ @NotNull
private final SegmentIdTable[] tables = new SegmentIdTable[32];
/**
* Number of segment tracked since this tracker was instantiated
*/
- @Nonnull
+ @NotNull
private final AtomicInteger segmentCounter = new AtomicInteger();
- @Nonnull
+ @NotNull
private final SegmentIdFactory segmentIdFactory;
- public SegmentTracker(@Nonnull SegmentIdFactory segmentIdFactory) {
+ public SegmentTracker(@NotNull SegmentIdFactory segmentIdFactory) {
this.segmentIdFactory = checkNotNull(segmentIdFactory);
for (int i = 0; i < tables.length; i++) {
tables[i] = new SegmentIdTable();
@@ -105,7 +105,7 @@ public class SegmentTracker implements S
* @return the segment id
*/
@Override
- @Nonnull
+ @NotNull
public SegmentId newSegmentId(long msb, long lsb) {
int index = ((int) msb) & (tables.length - 1);
return tables[index].newSegmentId(msb, lsb, segmentIdFactory);
@@ -117,7 +117,7 @@ public class SegmentTracker implements S
* @return the segment id
*/
@Override
- @Nonnull
+ @NotNull
public SegmentId newDataSegmentId() {
return newSegmentId(DATA);
}
@@ -128,12 +128,12 @@ public class SegmentTracker implements S
* @return the segment id
*/
@Override
- @Nonnull
+ @NotNull
public SegmentId newBulkSegmentId() {
return newSegmentId(BULK);
}
- @Nonnull
+ @NotNull
private SegmentId newSegmentId(long type) {
segmentCounter.incrementAndGet();
long msb = (random.nextLong() & MSB_MASK) | VERSION;
@@ -141,7 +141,7 @@ public class SegmentTracker implements S
return newSegmentId(msb, lsb);
}
- public synchronized void clearSegmentIdTables(@Nonnull Set<UUID> reclaimed, @Nonnull String gcInfo) {
+ public synchronized void clearSegmentIdTables(@NotNull Set<UUID> reclaimed, @NotNull String gcInfo) {
for (SegmentIdTable table : tables) {
table.clearSegmentIdTables(reclaimed, gcInfo);
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentWriter.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentWriter.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentWriter.java Wed Jul 18 15:02:27 2018
@@ -21,11 +21,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import org.apache.jackrabbit.oak.api.Blob;
import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Converts nodes, properties, values, etc. to records and persists them.
@@ -41,8 +40,8 @@ public interface SegmentWriter {
* @return the record id of the blob written
* @throws IOException
*/
- @Nonnull
- RecordId writeBlob(@Nonnull Blob blob) throws IOException;
+ @NotNull
+ RecordId writeBlob(@NotNull Blob blob) throws IOException;
/**
* Writes a stream value record. The given stream is consumed <em>and
@@ -53,8 +52,8 @@ public interface SegmentWriter {
* @throws IOException if the input stream could not be read or the output
* could not be written
*/
- @Nonnull
- RecordId writeStream(@Nonnull InputStream stream) throws IOException;
+ @NotNull
+ RecordId writeStream(@NotNull InputStream stream) throws IOException;
/**
* Write a node state. If non null, the passed {@code stableId} will be assigned to
@@ -65,8 +64,8 @@ public interface SegmentWriter {
* @return the record id of the segment node state written
* @throws IOException
*/
- @Nonnull
- RecordId writeNode(@Nonnull NodeState state, @Nullable ByteBuffer stableIdBytes) throws IOException;
+ @NotNull
+ RecordId writeNode(@NotNull NodeState state, @Nullable ByteBuffer stableIdBytes) throws IOException;
/**
* Write a node state.
@@ -75,8 +74,8 @@ public interface SegmentWriter {
*
* @see #writeNode(NodeState, ByteBuffer)
*/
- @Nonnull
- default RecordId writeNode(@Nonnull NodeState state) throws IOException {
+ @NotNull
+ default RecordId writeNode(@NotNull NodeState state) throws IOException {
return writeNode(state, null);
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/Template.java Wed Jul 18 15:02:27 2018
@@ -30,10 +30,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import com.google.common.base.Objects;
import com.google.common.collect.Lists;
import org.apache.jackrabbit.oak.api.PropertyState;
@@ -42,6 +38,8 @@ import org.apache.jackrabbit.oak.commons
import org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry;
import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* The in-memory representation of a "hidden class" of a node; inspired by the
@@ -61,28 +59,28 @@ public class Template {
static final String MANY_CHILD_NODES = "";
- @Nonnull
+ @NotNull
private final SegmentReader reader;
/**
* The {@code jcr:primaryType} property, if present as a single-valued
* {@code NAME} property. Otherwise {@code null}.
*/
- @CheckForNull
+ @Nullable
private final PropertyState primaryType;
/**
* The {@code jcr:mixinTypes} property, if present as a multi-valued
* {@code NAME} property. Otherwise {@code null}.
*/
- @CheckForNull
+ @Nullable
private final PropertyState mixinTypes;
/**
* Templates of all the properties of a node, excluding the
* above-mentioned {@code NAME}-valued type properties, if any.
*/
- @Nonnull
+ @NotNull
private final PropertyTemplate[] properties;
/**
@@ -90,10 +88,10 @@ public class Template {
* Otherwise {@link #ZERO_CHILD_NODES} (i.e. {@code null}) if there are
* no children, or {@link #MANY_CHILD_NODES} if there are more than one.
*/
- @CheckForNull
+ @Nullable
private final String childName;
- Template(@Nonnull SegmentReader reader,
+ Template(@NotNull SegmentReader reader,
@Nullable PropertyState primaryType,
@Nullable PropertyState mixinTypes,
@Nullable PropertyTemplate[] properties,
@@ -110,7 +108,7 @@ public class Template {
this.childName = childName;
}
- Template(@Nonnull SegmentReader reader, @Nonnull NodeState state) {
+ Template(@NotNull SegmentReader reader, @NotNull NodeState state) {
this.reader = checkNotNull(reader);
checkNotNull(state);
PropertyState primary = null;
@@ -146,12 +144,12 @@ public class Template {
}
}
- @CheckForNull
+ @Nullable
PropertyState getPrimaryType() {
return primaryType;
}
- @CheckForNull
+ @Nullable
PropertyState getMixinTypes() {
return mixinTypes;
}
@@ -186,7 +184,7 @@ public class Template {
return null;
}
- @CheckForNull
+ @Nullable
String getChildName() {
return childName;
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriteOperationHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriteOperationHandler.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriteOperationHandler.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriteOperationHandler.java Wed Jul 18 15:02:27 2018
@@ -21,7 +21,7 @@ package org.apache.jackrabbit.oak.segmen
import java.io.IOException;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* A {@code WriteOperationHandler} executes {@link WriteOperation
@@ -44,8 +44,8 @@ interface WriteOperationHandler {
* @return {@code RecordId} that resulted from persisting the changes.
* @throws IOException
*/
- @Nonnull
- RecordId execute(@Nonnull SegmentBufferWriter writer) throws IOException;
+ @NotNull
+ RecordId execute(@NotNull SegmentBufferWriter writer) throws IOException;
}
/**
@@ -54,13 +54,13 @@ interface WriteOperationHandler {
* @return {@code RecordId} that resulted from persisting the changes.
* @throws IOException
*/
- @Nonnull
- RecordId execute(@Nonnull WriteOperation writeOperation) throws IOException;
+ @NotNull
+ RecordId execute(@NotNull WriteOperation writeOperation) throws IOException;
/**
* Flush any pending changes on any {@link SegmentBufferWriter} managed by this instance.
* @param store the {@code SegmentStore} instance to write the {@code Segment} to
* @throws IOException
*/
- void flush(@Nonnull SegmentStore store) throws IOException;
+ void flush(@NotNull SegmentStore store) throws IOException;
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriterCacheManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriterCacheManager.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriterCacheManager.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/WriterCacheManager.java Wed Jul 18 15:02:27 2018
@@ -29,10 +29,6 @@ import static org.apache.jackrabbit.oak.
import java.util.Iterator;
import java.util.concurrent.ConcurrentMap;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
@@ -40,6 +36,8 @@ import com.google.common.cache.CacheStat
import org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean;
import org.apache.jackrabbit.oak.segment.file.PriorityCache;
import org.apache.jackrabbit.oak.stats.StatisticsProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Instances of this class manage the deduplication caches used by the {@link
@@ -89,20 +87,20 @@ public abstract class WriterCacheManager
/**
* @return cache for string records of the given {@code generation} and {@code operation}.
*/
- @Nonnull
+ @NotNull
public abstract Cache<String, RecordId> getStringCache(int generation);
/**
* @param generation
* @return cache for template records of the given {@code generation} and {@code operation}.
*/
- @Nonnull
+ @NotNull
public abstract Cache<Template, RecordId> getTemplateCache(int generation);
/**
* @return cache for node records of the given {@code generation} and {@code operation}.
*/
- @Nonnull
+ @NotNull
public abstract Cache<String, RecordId> getNodeCache(int generation);
/**
@@ -113,17 +111,17 @@ public abstract class WriterCacheManager
* @param statisticsProvider
* @return an instance of this cache with access statistics enabled.
*/
- @Nonnull
+ @NotNull
public WriterCacheManager withAccessTracking(
- @Nonnull String name,
- @Nonnull StatisticsProvider statisticsProvider) {
+ @NotNull String name,
+ @NotNull StatisticsProvider statisticsProvider) {
return new AccessTrackingCacheManager(checkNotNull(name), checkNotNull(statisticsProvider), this);
}
/**
* @return statistics for the string cache or {@code null} if not available.
*/
- @CheckForNull
+ @Nullable
public CacheStatsMBean getStringCacheStats() {
return null;
}
@@ -131,7 +129,7 @@ public abstract class WriterCacheManager
/**
* @return statistics for the template cache or {@code null} if not available.
*/
- @CheckForNull
+ @Nullable
public CacheStatsMBean getTemplateCacheStats() {
return null;
}
@@ -139,7 +137,7 @@ public abstract class WriterCacheManager
/**
* @return statistics for the node cache or {@code null} if not available.
*/
- @CheckForNull
+ @Nullable
public CacheStatsMBean getNodeCacheStats() {
return null;
}
@@ -149,7 +147,7 @@ public abstract class WriterCacheManager
* evictions per priority.
* @return occupancy information for the node deduplication cache.
*/
- @CheckForNull
+ @Nullable
public String getNodeCacheOccupancyInfo() { return null; }
/**
@@ -172,7 +170,7 @@ public abstract class WriterCacheManager
/**
* @return empty cache of size 0
*/
- @Nonnull
+ @NotNull
@Override
public RecordCache<String> getStringCache(int generation) {
return stringCache;
@@ -181,7 +179,7 @@ public abstract class WriterCacheManager
/**
* @return empty cache of size 0
*/
- @Nonnull
+ @NotNull
@Override
public RecordCache<Template> getTemplateCache(int generation) {
return templateCache;
@@ -190,21 +188,21 @@ public abstract class WriterCacheManager
/**
* @return a {@code Cache} cache that is always empty
*/
- @Nonnull
+ @NotNull
@Override
public Cache<String, RecordId> getNodeCache(int generation) {
return new Cache<String, RecordId>() {
@Override
- public void put(@Nonnull String stableId, @Nonnull RecordId recordId, byte cost) { }
+ public void put(@NotNull String stableId, @NotNull RecordId recordId, byte cost) { }
@Override
- public void put(@Nonnull String key, @Nonnull RecordId value) {
+ public void put(@NotNull String key, @NotNull RecordId value) {
throw new UnsupportedOperationException();
}
- @CheckForNull
+ @Nullable
@Override
- public RecordId get(@Nonnull String stableId) { return null; }
+ public RecordId get(@NotNull String stableId) { return null; }
};
}
}
@@ -243,9 +241,9 @@ public abstract class WriterCacheManager
* @param nodeCacheFactory factory for the node cache
*/
public Default(
- @Nonnull Supplier<RecordCache<String>> stringCacheFactory,
- @Nonnull Supplier<RecordCache<Template>> templateCacheFactory,
- @Nonnull Supplier<PriorityCache<String, RecordId>> nodeCacheFactory) {
+ @NotNull Supplier<RecordCache<String>> stringCacheFactory,
+ @NotNull Supplier<RecordCache<Template>> templateCacheFactory,
+ @NotNull Supplier<PriorityCache<String, RecordId>> nodeCacheFactory) {
this.stringCaches = new Generations<>(stringCacheFactory);
this.templateCaches = new Generations<>(templateCacheFactory);
this.nodeCache = memoize(nodeCacheFactory);
@@ -267,7 +265,7 @@ public abstract class WriterCacheManager
private final ConcurrentMap<Integer, Supplier<T>> generations = newConcurrentMap();
private final Supplier<T> cacheFactory;
- Generations(@Nonnull Supplier<T> cacheFactory) {
+ Generations(@NotNull Supplier<T> cacheFactory) {
this.cacheFactory = checkNotNull(cacheFactory);
}
@@ -279,7 +277,7 @@ public abstract class WriterCacheManager
return generations.get(generation).get();
}
- @Nonnull
+ @NotNull
@Override
public Iterator<T> iterator() {
return transform(generations.values().iterator(), new Function<Supplier<T>, T>() {
@@ -290,7 +288,7 @@ public abstract class WriterCacheManager
});
}
- void evictGenerations(@Nonnull Predicate<Integer> evict) {
+ void evictGenerations(@NotNull Predicate<Integer> evict) {
Iterator<Integer> it = generations.keySet().iterator();
while (it.hasNext()) {
if (evict.apply(it.next())) {
@@ -300,13 +298,13 @@ public abstract class WriterCacheManager
}
}
- @Nonnull
+ @NotNull
@Override
public Cache<String, RecordId> getStringCache(int generation) {
return stringCaches.getGeneration(generation);
}
- @Nonnull
+ @NotNull
@Override
public Cache<Template, RecordId> getTemplateCache(int generation) {
return templateCaches.getGeneration(generation);
@@ -317,28 +315,28 @@ public abstract class WriterCacheManager
}
@Override
- @Nonnull
+ @NotNull
public Cache<String, RecordId> getNodeCache(final int generation) {
return new Cache<String, RecordId>() {
@Override
- public void put(@Nonnull String stableId, @Nonnull RecordId recordId, byte cost) {
+ public void put(@NotNull String stableId, @NotNull RecordId recordId, byte cost) {
nodeCache().put(stableId, recordId, generation, cost);
}
@Override
- public void put(@Nonnull String key, @Nonnull RecordId value) {
+ public void put(@NotNull String key, @NotNull RecordId value) {
throw new UnsupportedOperationException();
}
- @CheckForNull
+ @Nullable
@Override
- public RecordId get(@Nonnull String stableId) {
+ public RecordId get(@NotNull String stableId) {
return nodeCache().get(stableId, generation);
}
};
}
- @CheckForNull
+ @Nullable
@Override
public CacheStatsMBean getStringCacheStats() {
return new RecordCacheStats("String deduplication cache stats",
@@ -347,7 +345,7 @@ public abstract class WriterCacheManager
accumulateRecordCacheWeights(stringCaches));
}
- @CheckForNull
+ @Nullable
@Override
public CacheStatsMBean getTemplateCacheStats() {
return new RecordCacheStats("Template deduplication cache stats",
@@ -356,7 +354,7 @@ public abstract class WriterCacheManager
accumulateRecordCacheWeights(templateCaches));
}
- @Nonnull
+ @NotNull
private static <T> Supplier<CacheStats> accumulateRecordCacheStats(
final Iterable<RecordCache<T>> caches) {
return new Supplier<CacheStats>() {
@@ -371,7 +369,7 @@ public abstract class WriterCacheManager
};
}
- @Nonnull
+ @NotNull
public static <T> Supplier<Long> accumulateRecordCacheSizes(
final Iterable<RecordCache<T>> caches) {
return new Supplier<Long>() {
@@ -386,7 +384,7 @@ public abstract class WriterCacheManager
};
}
- @Nonnull
+ @NotNull
public static <T> Supplier<Long> accumulateRecordCacheWeights(
final Iterable<RecordCache<T>> caches) {
return new Supplier<Long>() {
@@ -401,7 +399,7 @@ public abstract class WriterCacheManager
};
}
- @CheckForNull
+ @Nullable
@Override
public CacheStatsMBean getNodeCacheStats() {
return new RecordCacheStats("Node deduplication cache stats",
@@ -442,13 +440,13 @@ public abstract class WriterCacheManager
* into a {@link CacheAccessTracker}.
*/
private static class AccessTrackingCacheManager extends WriterCacheManager {
- @Nonnull
+ @NotNull
private final String name;
- @Nonnull
+ @NotNull
private final StatisticsProvider statisticsProvider;
- @Nonnull
+ @NotNull
private final WriterCacheManager delegate;
/**
@@ -463,9 +461,9 @@ public abstract class WriterCacheManager
* @see #getNodeCache(int)
*/
public AccessTrackingCacheManager(
- @Nonnull String name,
- @Nonnull StatisticsProvider statisticsProvider,
- @Nonnull WriterCacheManager delegate) {
+ @NotNull String name,
+ @NotNull StatisticsProvider statisticsProvider,
+ @NotNull WriterCacheManager delegate) {
this.name = name;
this.statisticsProvider = statisticsProvider;
this.delegate = delegate;
@@ -476,7 +474,7 @@ public abstract class WriterCacheManager
* the same name exposing access statistics under
* {@code "oak.segment.string-deduplication-cache-" + name}
*/
- @Nonnull
+ @NotNull
@Override
public Cache<String, RecordId> getStringCache(int generation) {
return new CacheAccessTracker<>(
@@ -490,7 +488,7 @@ public abstract class WriterCacheManager
* the same name exposing access statistics under
* {@code "oak.segment.template-deduplication-cache-" + name}
*/
- @Nonnull
+ @NotNull
@Override
public Cache<Template, RecordId> getTemplateCache(int generation) {
return new CacheAccessTracker<>(
@@ -504,7 +502,7 @@ public abstract class WriterCacheManager
* the same name exposing access statistics under
* {@code "oak.segment.node-deduplication-cache-" + name}
*/
- @Nonnull
+ @NotNull
@Override
public Cache<String, RecordId> getNodeCache(int generation) {
return new CacheAccessTracker<>(
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentGCOptions.java Wed Jul 18 15:02:27 2018
@@ -19,7 +19,7 @@
package org.apache.jackrabbit.oak.segment.compaction;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* This class holds configuration options for segment store revision gc.
@@ -96,7 +96,7 @@ public class SegmentGCOptions {
private int retainedGenerations = RETAINED_GENERATIONS_DEFAULT;
- @Nonnull
+ @NotNull
private GCType gcType = GCType.FULL;
private boolean offline = false;
@@ -217,7 +217,7 @@ public class SegmentGCOptions {
/**
* @return the currently set gc type.
*/
- @Nonnull
+ @NotNull
public GCType getGCType() {
return gcType;
}
@@ -226,7 +226,7 @@ public class SegmentGCOptions {
* Set the gc type.
* @param gcType the type of gc to run.
*/
- public void setGCType(@Nonnull GCType gcType) {
+ public void setGCType(@NotNull GCType gcType) {
this.gcType = gcType;
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGC.java Wed Jul 18 15:02:27 2018
@@ -19,10 +19,9 @@
package org.apache.jackrabbit.oak.segment.compaction;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.spi.gc.GCMonitor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* This MBean exposes the settings from {@link SegmentGCOptions} and
@@ -141,19 +140,19 @@ public interface SegmentRevisionGC {
/**
* @return last error or {@code null} if none.
*/
- @CheckForNull
+ @Nullable
String getLastError();
/**
* @return last log message or {@code null} if none.
*/
- @Nonnull
+ @NotNull
String getLastLogMessage();
/**
* @return current status.
*/
- @Nonnull
+ @NotNull
String getStatus();
/**
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/compaction/SegmentRevisionGCMBean.java Wed Jul 18 15:02:27 2018
@@ -22,13 +22,12 @@ package org.apache.jackrabbit.oak.segmen
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.RETAINED_GENERATIONS_DEFAULT;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.commons.jmx.AnnotatedStandardMBean;
import org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.GCType;
import org.apache.jackrabbit.oak.segment.file.FileStore;
import org.apache.jackrabbit.oak.segment.file.FileStoreGCMonitor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -38,19 +37,19 @@ public class SegmentRevisionGCMBean
private static final Logger log = LoggerFactory.getLogger(SegmentRevisionGCMBean.class);
- @Nonnull
+ @NotNull
private final FileStore fileStore;
- @Nonnull
+ @NotNull
private final SegmentGCOptions gcOptions;
- @Nonnull
+ @NotNull
private final FileStoreGCMonitor fileStoreGCMonitor;
public SegmentRevisionGCMBean(
- @Nonnull FileStore fileStore,
- @Nonnull SegmentGCOptions gcOptions,
- @Nonnull FileStoreGCMonitor fileStoreGCMonitor) {
+ @NotNull FileStore fileStore,
+ @NotNull SegmentGCOptions gcOptions,
+ @NotNull FileStoreGCMonitor fileStoreGCMonitor) {
super(SegmentRevisionGC.class);
this.fileStore = checkNotNull(fileStore);
this.gcOptions = checkNotNull(gcOptions);
@@ -166,19 +165,19 @@ public class SegmentRevisionGCMBean
return fileStoreGCMonitor.getLastReclaimedSize();
}
- @CheckForNull
+ @Nullable
@Override
public String getLastError() {
return fileStoreGCMonitor.getLastError();
}
- @Nonnull
+ @NotNull
@Override
public String getLastLogMessage() {
return fileStoreGCMonitor.getLastLogMessage();
}
- @Nonnull
+ @NotNull
@Override
public String getStatus() {
return fileStoreGCMonitor.getStatus();
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java Wed Jul 18 15:02:27 2018
@@ -29,9 +29,6 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean;
import org.apache.jackrabbit.oak.segment.CachingSegmentReader;
import org.apache.jackrabbit.oak.segment.RecordType;
@@ -56,6 +53,8 @@ import org.apache.jackrabbit.oak.segment
import org.apache.jackrabbit.oak.segment.file.tar.TarFiles;
import org.apache.jackrabbit.oak.segment.file.tar.TarRecovery;
import org.apache.jackrabbit.oak.spi.blob.BlobStore;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -95,10 +94,10 @@ public abstract class AbstractFileStore
);
}
- @Nonnull
+ @NotNull
final SegmentTracker tracker;
- @Nonnull
+ @NotNull
final CachingSegmentReader segmentReader;
final File directory;
@@ -107,7 +106,7 @@ public abstract class AbstractFileStore
final boolean memoryMapping;
- @Nonnull
+ @NotNull
final SegmentCache segmentCache;
final TarRecovery recovery = new TarRecovery() {
@@ -124,7 +123,7 @@ public abstract class AbstractFileStore
AbstractFileStore(final FileStoreBuilder builder) {
this.directory = builder.getDirectory();
this.tracker = new SegmentTracker(new SegmentIdFactory() {
- @Override @Nonnull
+ @Override @NotNull
public SegmentId newSegmentId(long msb, long lsb) {
return new SegmentId(AbstractFileStore.this, msb, lsb, segmentCache::recordHit);
}
@@ -143,30 +142,30 @@ public abstract class AbstractFileStore
return new SegmentNotFoundException(id, e);
}
- @Nonnull
+ @NotNull
public CacheStatsMBean getSegmentCacheStats() {
return segmentCache.getCacheStats();
}
- @Nonnull
+ @NotNull
public CacheStatsMBean getStringCacheStats() {
return segmentReader.getStringCacheStats();
}
- @Nonnull
+ @NotNull
public CacheStatsMBean getTemplateCacheStats() {
return segmentReader.getTemplateCacheStats();
}
- @Nonnull
+ @NotNull
public abstract SegmentWriter getWriter();
- @Nonnull
+ @NotNull
public SegmentReader getReader() {
return segmentReader;
}
- @Nonnull
+ @NotNull
public SegmentIdProvider getSegmentIdProvider() {
return tracker;
}
@@ -184,7 +183,7 @@ public abstract class AbstractFileStore
* </pre>
* @return the current head node state
*/
- @Nonnull
+ @NotNull
public SegmentNodeState getHead() {
return segmentReader.readHeadState(getRevisions());
}
@@ -192,7 +191,7 @@ public abstract class AbstractFileStore
/**
* @return the external BlobStore (if configured) with this store, {@code null} otherwise.
*/
- @CheckForNull
+ @Nullable
public BlobStore getBlobStore() {
return blobStore;
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CleanupFirstCompactionStrategy.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CleanupFirstCompactionStrategy.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CleanupFirstCompactionStrategy.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CleanupFirstCompactionStrategy.java Wed Jul 18 15:02:27 2018
@@ -30,14 +30,13 @@ import java.util.List;
import java.util.Set;
import java.util.UUID;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Joiner;
import com.google.common.base.Predicate;
import org.apache.jackrabbit.oak.segment.SegmentId;
import org.apache.jackrabbit.oak.segment.file.tar.CleanupContext;
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
import org.apache.jackrabbit.oak.segment.file.tar.TarFiles;
+import org.jetbrains.annotations.NotNull;
class CleanupFirstCompactionStrategy implements CompactionStrategy {
@@ -185,7 +184,7 @@ class CleanupFirstCompactionStrategy imp
};
}
- private static String toFileNames(@Nonnull List<String> files) {
+ private static String toFileNames(@NotNull List<String> files) {
if (files.isEmpty()) {
return "none";
} else {
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionResult.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionResult.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionResult.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/CompactionResult.java Wed Jul 18 15:02:27 2018
@@ -21,12 +21,11 @@ package org.apache.jackrabbit.oak.segmen
import static org.apache.jackrabbit.oak.segment.file.Reclaimers.newOldReclaimer;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Predicate;
import org.apache.jackrabbit.oak.segment.RecordId;
import org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions;
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
+import org.jetbrains.annotations.NotNull;
/**
* Instances of this class represent the result from a compaction. Either
@@ -34,12 +33,12 @@ import org.apache.jackrabbit.oak.segment
*/
abstract class CompactionResult {
- @Nonnull
+ @NotNull
private final GCGeneration currentGeneration;
private final int gcCount;
- private CompactionResult(@Nonnull GCGeneration currentGeneration, int gcCount) {
+ private CompactionResult(@NotNull GCGeneration currentGeneration, int gcCount) {
this.currentGeneration = currentGeneration;
this.gcCount = gcCount;
}
@@ -53,10 +52,10 @@ abstract class CompactionResult {
* @param compactedRootId the record id of the root created by compaction
*/
static CompactionResult succeeded(
- @Nonnull SegmentGCOptions.GCType gcType,
- @Nonnull GCGeneration newGeneration,
- @Nonnull final SegmentGCOptions gcOptions,
- @Nonnull final RecordId compactedRootId,
+ @NotNull SegmentGCOptions.GCType gcType,
+ @NotNull GCGeneration newGeneration,
+ @NotNull final SegmentGCOptions gcOptions,
+ @NotNull final RecordId compactedRootId,
int gcCount
) {
return new CompactionResult(newGeneration, gcCount) {
@@ -86,8 +85,8 @@ abstract class CompactionResult {
* create
*/
static CompactionResult aborted(
- @Nonnull GCGeneration currentGeneration,
- @Nonnull final GCGeneration failedGeneration,
+ @NotNull GCGeneration currentGeneration,
+ @NotNull final GCGeneration failedGeneration,
int gcCount
) {
return new CompactionResult(currentGeneration, gcCount) {
@@ -113,10 +112,10 @@ abstract class CompactionResult {
* @param gcOptions the current GC options used by compaction
*/
static CompactionResult skipped(
- @Nonnull SegmentGCOptions.GCType lastGCType,
- @Nonnull GCGeneration currentGeneration,
- @Nonnull final SegmentGCOptions gcOptions,
- @Nonnull final RecordId compactedRootId,
+ @NotNull SegmentGCOptions.GCType lastGCType,
+ @NotNull GCGeneration currentGeneration,
+ @NotNull final SegmentGCOptions gcOptions,
+ @NotNull final RecordId compactedRootId,
int gcCount
) {
return new CompactionResult(currentGeneration, gcCount) {
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/DefaultCleanupStrategy.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/DefaultCleanupStrategy.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/DefaultCleanupStrategy.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/DefaultCleanupStrategy.java Wed Jul 18 15:02:27 2018
@@ -30,14 +30,13 @@ import java.util.List;
import java.util.Set;
import java.util.UUID;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Joiner;
import com.google.common.base.Predicate;
import org.apache.jackrabbit.oak.segment.SegmentId;
import org.apache.jackrabbit.oak.segment.file.tar.CleanupContext;
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
import org.apache.jackrabbit.oak.segment.file.tar.TarFiles;
+import org.jetbrains.annotations.NotNull;
class DefaultCleanupStrategy implements CleanupStrategy {
@@ -115,7 +114,7 @@ class DefaultCleanupStrategy implements
};
}
- private static String toFileNames(@Nonnull List<String> files) {
+ private static String toFileNames(@NotNull List<String> files) {
if (files.isEmpty()) {
return "none";
} else {
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java Wed Jul 18 15:02:27 2018
@@ -34,8 +34,6 @@ import java.util.concurrent.ExecutionExc
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Supplier;
import com.google.common.io.Closer;
import com.google.common.util.concurrent.UncheckedExecutionException;
@@ -54,6 +52,7 @@ import org.apache.jackrabbit.oak.segment
import org.apache.jackrabbit.oak.segment.spi.persistence.RepositoryLock;
import org.apache.jackrabbit.oak.segment.spi.persistence.SegmentNodeStorePersistence;
import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -73,10 +72,10 @@ public class FileStore extends AbstractF
return new SynchronizedGarbageCollectionStrategy(new CleanupFirstGarbageCollectionStrategy());
}
- @Nonnull
+ @NotNull
private final SegmentWriter segmentWriter;
- @Nonnull
+ @NotNull
private final GarbageCollector garbageCollector;
private final TarFiles tarFiles;
@@ -113,7 +112,7 @@ public class FileStore extends AbstractF
private final ShutDown shutDown = new ShutDown();
- @Nonnull
+ @NotNull
private final SegmentNotFoundExceptionListener snfeListener;
private final GarbageCollectionStrategy garbageCollectionStrategy = newGarbageCollectionStrategy();
@@ -211,7 +210,7 @@ public class FileStore extends AbstractF
}
}
- @Nonnull
+ @NotNull
private Supplier<RecordId> initialNode() {
return new Supplier<RecordId>() {
@Override
@@ -232,7 +231,7 @@ public class FileStore extends AbstractF
};
}
- @Nonnull
+ @NotNull
private GCGeneration getGcGeneration() {
return revisions.getHead().getSegmentId().getGcGeneration();
}
@@ -413,7 +412,7 @@ public class FileStore extends AbstractF
}
@Override
- @Nonnull
+ @NotNull
public SegmentWriter getWriter() {
try (ShutDownCloser ignored = shutDown.keepAlive()) {
return segmentWriter;
@@ -421,7 +420,7 @@ public class FileStore extends AbstractF
}
@Override
- @Nonnull
+ @NotNull
public TarRevisions getRevisions() {
try (ShutDownCloser ignored = shutDown.keepAlive()) {
return revisions;
@@ -464,7 +463,7 @@ public class FileStore extends AbstractF
}
@Override
- @Nonnull
+ @NotNull
public Segment readSegment(final SegmentId id) {
try (ShutDownCloser ignored = shutDown.keepAlive()) {
return segmentCache.getSegment(id, () -> readSegmentUncached(tarFiles, id));
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreBuilder.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreBuilder.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreBuilder.java Wed Jul 18 15:02:27 2018
@@ -35,9 +35,6 @@ import java.io.File;
import java.io.IOException;
import java.util.Set;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Predicate;
import org.apache.jackrabbit.oak.segment.CacheWeights.NodeCacheWeigher;
import org.apache.jackrabbit.oak.segment.CacheWeights.StringCacheWeigher;
@@ -60,6 +57,8 @@ import org.apache.jackrabbit.oak.spi.gc.
import org.apache.jackrabbit.oak.spi.gc.GCMonitor;
import org.apache.jackrabbit.oak.spi.gc.LoggingGCMonitor;
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;
@@ -74,10 +73,10 @@ public class FileStoreBuilder {
public static final int DEFAULT_MAX_FILE_SIZE = 256;
- @Nonnull
+ @NotNull
private final File directory;
- @CheckForNull
+ @Nullable
private BlobStore blobStore; // null -> store blobs inline
private int maxFileSize = DEFAULT_MAX_FILE_SIZE;
@@ -98,18 +97,18 @@ public class FileStoreBuilder {
private SegmentNodeStorePersistence persistence;
- @Nonnull
+ @NotNull
private StatisticsProvider statsProvider = StatisticsProvider.NOOP;
- @Nonnull
+ @NotNull
private SegmentGCOptions gcOptions = defaultGCOptions();
- @CheckForNull
+ @Nullable
private EvictingWriteCacheManager cacheManager;
private class FileStoreGCListener extends DelegatingGCMonitor implements GCListener {
@Override
- public void compactionSucceeded(@Nonnull GCGeneration newGeneration) {
+ public void compactionSucceeded(@NotNull GCGeneration newGeneration) {
compacted();
if (cacheManager != null) {
cacheManager.evictOldGeneration(newGeneration.getGeneration());
@@ -117,20 +116,20 @@ public class FileStoreBuilder {
}
@Override
- public void compactionFailed(@Nonnull GCGeneration failedGeneration) {
+ public void compactionFailed(@NotNull GCGeneration failedGeneration) {
if (cacheManager != null) {
cacheManager.evictGeneration(failedGeneration.getGeneration());
}
}
}
- @Nonnull
+ @NotNull
private final FileStoreGCListener gcListener = new FileStoreGCListener();
- @Nonnull
+ @NotNull
private SegmentNotFoundExceptionListener snfeListener = LOG_SNFE;
- @Nonnull
+ @NotNull
private final Set<IOMonitor> ioMonitors = newHashSet();
private boolean strictVersionCheck;
@@ -142,12 +141,12 @@ public class FileStoreBuilder {
* @param directory directory where the tar files are stored
* @return a new {@code FileStoreBuilder} instance.
*/
- @Nonnull
- public static FileStoreBuilder fileStoreBuilder(@Nonnull File directory) {
+ @NotNull
+ public static FileStoreBuilder fileStoreBuilder(@NotNull File directory) {
return new FileStoreBuilder(directory);
}
- private FileStoreBuilder(@Nonnull File directory) {
+ private FileStoreBuilder(@NotNull File directory) {
this.directory = checkNotNull(directory);
this.gcListener.registerGCMonitor(new LoggingGCMonitor(LOG));
this.persistence = new TarPersistence(directory);
@@ -158,8 +157,8 @@ public class FileStoreBuilder {
* @param blobStore
* @return this instance
*/
- @Nonnull
- public FileStoreBuilder withBlobStore(@Nonnull BlobStore blobStore) {
+ @NotNull
+ public FileStoreBuilder withBlobStore(@NotNull BlobStore blobStore) {
this.blobStore = checkNotNull(blobStore);
return this;
}
@@ -169,7 +168,7 @@ public class FileStoreBuilder {
* @param maxFileSize
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withMaxFileSize(int maxFileSize) {
this.maxFileSize = maxFileSize;
return this;
@@ -180,7 +179,7 @@ public class FileStoreBuilder {
* @param segmentCacheSize None negative cache size
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withSegmentCacheSize(int segmentCacheSize) {
this.segmentCacheSize = segmentCacheSize;
return this;
@@ -191,7 +190,7 @@ public class FileStoreBuilder {
* @param stringCacheSize None negative cache size
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withStringCacheSize(int stringCacheSize) {
this.stringCacheSize = stringCacheSize;
return this;
@@ -202,7 +201,7 @@ public class FileStoreBuilder {
* @param templateCacheSize None negative cache size
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withTemplateCacheSize(int templateCacheSize) {
this.templateCacheSize = templateCacheSize;
return this;
@@ -213,7 +212,7 @@ public class FileStoreBuilder {
* @param stringDeduplicationCacheSize None negative cache size
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withStringDeduplicationCacheSize(int stringDeduplicationCacheSize) {
this.stringDeduplicationCacheSize = stringDeduplicationCacheSize;
return this;
@@ -224,7 +223,7 @@ public class FileStoreBuilder {
* @param templateDeduplicationCacheSize None negative cache size
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withTemplateDeduplicationCacheSize(int templateDeduplicationCacheSize) {
this.templateDeduplicationCacheSize = templateDeduplicationCacheSize;
return this;
@@ -235,7 +234,7 @@ public class FileStoreBuilder {
* @param nodeDeduplicationCacheSize None negative cache size. Must be a power of 2.
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withNodeDeduplicationCacheSize(int nodeDeduplicationCacheSize) {
this.nodeDeduplicationCacheSize = nodeDeduplicationCacheSize;
return this;
@@ -246,7 +245,7 @@ public class FileStoreBuilder {
* @param memoryMapping
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withMemoryMapping(boolean memoryMapping) {
this.memoryMapping = memoryMapping;
return this;
@@ -256,7 +255,7 @@ public class FileStoreBuilder {
* Set memory mapping to the default value based on OS properties
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withDefaultMemoryMapping() {
this.memoryMapping = MEMORY_MAPPING_DEFAULT;
return this;
@@ -267,8 +266,8 @@ public class FileStoreBuilder {
* @param gcMonitor
* @return this instance
*/
- @Nonnull
- public FileStoreBuilder withGCMonitor(@Nonnull GCMonitor gcMonitor) {
+ @NotNull
+ public FileStoreBuilder withGCMonitor(@NotNull GCMonitor gcMonitor) {
this.gcListener.registerGCMonitor(checkNotNull(gcMonitor));
return this;
}
@@ -278,8 +277,8 @@ public class FileStoreBuilder {
* @param statisticsProvider
* @return this instance
*/
- @Nonnull
- public FileStoreBuilder withStatisticsProvider(@Nonnull StatisticsProvider statisticsProvider) {
+ @NotNull
+ public FileStoreBuilder withStatisticsProvider(@NotNull StatisticsProvider statisticsProvider) {
this.statsProvider = checkNotNull(statisticsProvider);
return this;
}
@@ -289,7 +288,7 @@ public class FileStoreBuilder {
* @param gcOptions
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withGCOptions(SegmentGCOptions gcOptions) {
this.gcOptions = checkNotNull(gcOptions);
return this;
@@ -300,14 +299,14 @@ public class FileStoreBuilder {
* @param snfeListener, the actual listener
* @return this instance
*/
- @Nonnull
- public FileStoreBuilder withSnfeListener(@Nonnull SegmentNotFoundExceptionListener snfeListener) {
+ @NotNull
+ public FileStoreBuilder withSnfeListener(@NotNull SegmentNotFoundExceptionListener snfeListener) {
this.snfeListener = checkNotNull(snfeListener);
return this;
}
- @Nonnull
- public FileStoreBuilder withIOMonitor(@Nonnull IOMonitor ioMonitor) {
+ @NotNull
+ public FileStoreBuilder withIOMonitor(@NotNull IOMonitor ioMonitor) {
ioMonitors.add(checkNotNull(ioMonitor));
return this;
}
@@ -317,8 +316,8 @@ public class FileStoreBuilder {
* @param logger logger for logging IO reads
* @return this.
*/
- @Nonnull
- public FileStoreBuilder withIOLogging(@Nonnull Logger logger) {
+ @NotNull
+ public FileStoreBuilder withIOLogging(@NotNull Logger logger) {
if (logger.isDebugEnabled()) {
ioMonitors.add(new IOTraceMonitor(new IOTraceLogWriter(logger)));
}
@@ -333,7 +332,7 @@ public class FileStoreBuilder {
* @param strictVersionCheck enables strict version checking iff {@code true}.
* @return this instance
*/
- @Nonnull
+ @NotNull
public FileStoreBuilder withStrictVersionCheck(boolean strictVersionCheck) {
this.strictVersionCheck = strictVersionCheck;
return this;
@@ -365,7 +364,7 @@ public class FileStoreBuilder {
* @return a new file store instance
* @throws IOException
*/
- @Nonnull
+ @NotNull
public FileStore build() throws InvalidFileStoreVersionException, IOException {
checkState(!built, "Cannot re-use builder");
built = true;
@@ -404,7 +403,7 @@ public class FileStoreBuilder {
* @return a new file store instance
* @throws IOException
*/
- @Nonnull
+ @NotNull
public ReadOnlyFileStore buildReadOnly() throws InvalidFileStoreVersionException, IOException {
checkState(!built, "Cannot re-use builder");
checkState(directory.exists() && directory.isDirectory(),
@@ -427,12 +426,12 @@ public class FileStoreBuilder {
return store;
}
- @Nonnull
+ @NotNull
File getDirectory() {
return directory;
}
- @CheckForNull
+ @Nullable
BlobStore getBlobStore() {
return blobStore;
}
@@ -457,22 +456,22 @@ public class FileStoreBuilder {
return memoryMapping;
}
- @Nonnull
+ @NotNull
GCListener getGcListener() {
return gcListener;
}
- @Nonnull
+ @NotNull
StatisticsProvider getStatsProvider() {
return statsProvider;
}
- @Nonnull
+ @NotNull
SegmentGCOptions getGcOptions() {
return gcOptions;
}
- @Nonnull
+ @NotNull
SegmentNotFoundExceptionListener getSnfeListener() {
return snfeListener;
}
@@ -489,7 +488,7 @@ public class FileStoreBuilder {
* @see #withStringDeduplicationCacheSize(int)
* @see #withTemplateDeduplicationCacheSize(int)
*/
- @Nonnull
+ @NotNull
public WriterCacheManager getCacheManager() {
if (cacheManager == null) {
cacheManager = new EvictingWriteCacheManager(stringDeduplicationCacheSize,
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreGCMonitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreGCMonitor.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreGCMonitor.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreGCMonitor.java Wed Jul 18 15:02:27 2018
@@ -25,11 +25,10 @@ import static org.slf4j.helpers.MessageF
import java.io.PrintWriter;
import java.io.StringWriter;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.segment.compaction.SegmentGCStatus;
import org.apache.jackrabbit.oak.spi.gc.GCMonitor;
import org.apache.jackrabbit.oak.stats.Clock;
+import org.jetbrains.annotations.NotNull;
/**
* {@link GCMonitor} implementation providing the file store gc status.
@@ -45,7 +44,7 @@ public class FileStoreGCMonitor implemen
private String lastLogMessage;
private String status = SegmentGCStatus.IDLE.message();
- public FileStoreGCMonitor(@Nonnull Clock clock) {
+ public FileStoreGCMonitor(@NotNull Clock clock) {
this.clock = checkNotNull(clock);
}
@@ -111,12 +110,12 @@ public class FileStoreGCMonitor implemen
return lastError;
}
- @Nonnull
+ @NotNull
public String getLastLogMessage() {
return lastLogMessage;
}
- @Nonnull
+ @NotNull
public String getStatus() {
return status;
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreStats.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreStats.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreStats.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStoreStats.java Wed Jul 18 15:02:27 2018
@@ -21,7 +21,6 @@ package org.apache.jackrabbit.oak.segmen
import static org.apache.jackrabbit.stats.TimeSeriesStatsUtil.asCompositeData;
-import javax.annotation.Nonnull;
import javax.management.openmbean.CompositeData;
import org.apache.jackrabbit.api.stats.TimeSeries;
@@ -31,6 +30,7 @@ import org.apache.jackrabbit.oak.stats.C
import org.apache.jackrabbit.oak.stats.MeterStats;
import org.apache.jackrabbit.oak.stats.StatisticsProvider;
import org.apache.jackrabbit.oak.stats.StatsOptions;
+import org.jetbrains.annotations.NotNull;
public class FileStoreStats implements FileStoreStatsMBean, FileStoreMonitor {
public static final String SEGMENT_REPO_SIZE = "SEGMENT_REPO_SIZE";
@@ -91,13 +91,13 @@ public class FileStoreStats implements F
return store.getSegmentCount();
}
- @Nonnull
+ @NotNull
@Override
public CompositeData getWriteStats() {
return asCompositeData(getTimeSeries(SEGMENT_WRITES), SEGMENT_WRITES);
}
- @Nonnull
+ @NotNull
@Override
public CompositeData getRepositorySize() {
return asCompositeData(getTimeSeries(SEGMENT_REPO_SIZE), SEGMENT_REPO_SIZE);
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCJournal.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCJournal.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCJournal.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCJournal.java Wed Jul 18 15:02:27 2018
@@ -27,14 +27,13 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Joiner;
import org.apache.jackrabbit.oak.segment.RecordId;
import org.apache.jackrabbit.oak.segment.spi.persistence.GCJournalFile;
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
import org.apache.jackrabbit.oak.segment.file.tar.TarPersistence;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +51,7 @@ public class GCJournal {
private GCJournalEntry latest;
- public GCJournal(@Nonnull GCJournalFile journalFile) {
+ public GCJournal(@NotNull GCJournalFile journalFile) {
this.journalFile = journalFile;
}
@@ -69,7 +68,7 @@ public class GCJournal {
* @param root record id of the compacted root node
*/
public synchronized void persist(long reclaimedSize, long repoSize,
- @Nonnull GCGeneration gcGeneration, long nodes, @Nonnull String root
+ @NotNull GCGeneration gcGeneration, long nodes, @NotNull String root
) {
GCJournalEntry current = read();
if (current.getGcGeneration().equals(gcGeneration)) {
@@ -133,16 +132,16 @@ public class GCJournal {
private final long ts;
- @Nonnull
+ @NotNull
private final GCGeneration gcGeneration;
private final long nodes;
- @Nonnull
+ @NotNull
private final String root;
public GCJournalEntry(long repoSize, long reclaimedSize, long ts,
- @Nonnull GCGeneration gcGeneration, long nodes, @Nonnull String root
+ @NotNull GCGeneration gcGeneration, long nodes, @NotNull String root
) {
this.repoSize = repoSize;
this.reclaimedSize = reclaimedSize;
@@ -190,7 +189,7 @@ public class GCJournal {
newGCGeneration(generation, fullGeneration, false), nodes, root);
}
- @CheckForNull
+ @Nullable
private static String parseString(String[] items, int index) {
if (index >= items.length) {
return null;
@@ -246,7 +245,7 @@ public class GCJournal {
/**
* Returns the gc generation
*/
- @Nonnull
+ @NotNull
public GCGeneration getGcGeneration() {
return gcGeneration;
}
@@ -261,7 +260,7 @@ public class GCJournal {
/**
* Returns the record id of the root created by the compactor
*/
- @Nonnull
+ @NotNull
public String getRoot() {
return root;
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCListener.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCListener.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCListener.java Wed Jul 18 15:02:27 2018
@@ -19,10 +19,9 @@
package org.apache.jackrabbit.oak.segment.file;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
import org.apache.jackrabbit.oak.spi.gc.GCMonitor;
+import org.jetbrains.annotations.NotNull;
/**
* Listener receiving notifications about the garbage collection process
@@ -34,12 +33,12 @@ interface GCListener extends GCMonitor {
* a new generation of segments
* @param newGeneration the new generation number
*/
- void compactionSucceeded(@Nonnull GCGeneration newGeneration);
+ void compactionSucceeded(@NotNull GCGeneration newGeneration);
/**
* Notification of a failed compaction. A new generation of
* segments could not be created.
* @param failedGeneration the generation number that could not be created
*/
- void compactionFailed(@Nonnull GCGeneration failedGeneration);
+ void compactionFailed(@NotNull GCGeneration failedGeneration);
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCMemoryBarrier.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCMemoryBarrier.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCMemoryBarrier.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCMemoryBarrier.java Wed Jul 18 15:02:27 2018
@@ -30,7 +30,6 @@ import java.lang.management.MemoryPoolMX
import java.lang.management.MemoryUsage;
import java.util.concurrent.atomic.AtomicBoolean;
-import javax.annotation.Nonnull;
import javax.management.ListenerNotFoundException;
import javax.management.Notification;
import javax.management.NotificationEmitter;
@@ -38,6 +37,7 @@ import javax.management.NotificationList
import javax.management.openmbean.CompositeData;
import org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions;
+import org.jetbrains.annotations.NotNull;
/**
* Responsible for raising the low memory flag whenever the available memory
@@ -49,21 +49,21 @@ public class GCMemoryBarrier implements
// TODO possibly add a min value to the percentage, ie. skip gc if available
// heap drops under 2GB
- @Nonnull
+ @NotNull
private final AtomicBoolean sufficientMemory;
- @Nonnull
+ @NotNull
private final GCListener gcListener;
- @Nonnull
+ @NotNull
private final SegmentGCOptions gcOptions;
private final NotificationEmitter emitter;
private final MemoryListener listener;
- public GCMemoryBarrier(@Nonnull AtomicBoolean sufficientMemory,
- @Nonnull GCListener gcListener,
- @Nonnull SegmentGCOptions gcOptions) {
+ public GCMemoryBarrier(@NotNull AtomicBoolean sufficientMemory,
+ @NotNull GCListener gcListener,
+ @NotNull SegmentGCOptions gcOptions) {
this.sufficientMemory = sufficientMemory;
this.gcListener = gcListener;
this.gcOptions = gcOptions;
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCNodeWriteMonitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCNodeWriteMonitor.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCNodeWriteMonitor.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GCNodeWriteMonitor.java Wed Jul 18 15:02:27 2018
@@ -18,9 +18,8 @@
*/
package org.apache.jackrabbit.oak.segment.file;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.spi.gc.GCMonitor;
+import org.jetbrains.annotations.NotNull;
/**
* Monitors the compaction cycle and keeps a compacted nodes counter, in order
@@ -65,7 +64,7 @@ public class GCNodeWriteMonitor {
private boolean running = false;
- public GCNodeWriteMonitor(long gcProgressLog, @Nonnull GCMonitor gcMonitor) {
+ public GCNodeWriteMonitor(long gcProgressLog, @NotNull GCMonitor gcMonitor) {
this.gcProgressLog = gcProgressLog;
this.gcMonitor = gcMonitor;
}
@@ -128,7 +127,7 @@ public class GCNodeWriteMonitor {
return estimated;
}
- @Nonnull
+ @NotNull
private String getPercentageDone() {
return estimated > 0
? getEstimatedPercentage() + "% complete."
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GarbageCollector.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GarbageCollector.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GarbageCollector.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/GarbageCollector.java Wed Jul 18 15:02:27 2018
@@ -29,8 +29,6 @@ import java.util.concurrent.atomic.Atomi
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Supplier;
import org.apache.jackrabbit.oak.segment.Revisions;
import org.apache.jackrabbit.oak.segment.SegmentCache;
@@ -43,6 +41,7 @@ import org.apache.jackrabbit.oak.segment
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
import org.apache.jackrabbit.oak.segment.file.tar.TarFiles;
import org.apache.jackrabbit.oak.spi.blob.BlobStore;
+import org.jetbrains.annotations.NotNull;
class GarbageCollector {
@@ -59,16 +58,16 @@ class GarbageCollector {
*/
private static final long GC_BACKOFF = getInteger("oak.gc.backoff", 10 * 3600 * 1000);
- @Nonnull
+ @NotNull
private final SegmentGCOptions gcOptions;
/**
* {@code GcListener} listening to this instance's gc progress
*/
- @Nonnull
+ @NotNull
private final PrefixedGCListener gcListener;
- @Nonnull
+ @NotNull
private final GCJournal gcJournal;
private final AtomicBoolean sufficientMemory;
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/JournalEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/JournalEntry.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/JournalEntry.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/JournalEntry.java Wed Jul 18 15:02:27 2018
@@ -19,23 +19,23 @@
package org.apache.jackrabbit.oak.segment.file;
-import javax.annotation.Nonnull;
+import org.jetbrains.annotations.NotNull;
/**
* A value class representing an entry in the revisions journal.
*/
public class JournalEntry {
- @Nonnull
+ @NotNull
private final String revision;
private final long timestamp;
- JournalEntry(@Nonnull String revision, long timestamp) {
+ JournalEntry(@NotNull String revision, long timestamp) {
this.revision = revision;
this.timestamp = timestamp;
}
- @Nonnull
+ @NotNull
public String getRevision() {
return revision;
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/MetricsIOMonitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/MetricsIOMonitor.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/MetricsIOMonitor.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/MetricsIOMonitor.java Wed Jul 18 15:02:27 2018
@@ -22,13 +22,12 @@ import static java.util.concurrent.TimeU
import java.io.File;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitorAdapter;
import org.apache.jackrabbit.oak.stats.MeterStats;
import org.apache.jackrabbit.oak.stats.StatisticsProvider;
import org.apache.jackrabbit.oak.stats.StatsOptions;
import org.apache.jackrabbit.oak.stats.TimerStats;
+import org.jetbrains.annotations.NotNull;
/**
* This {@code IOMonitor} implementations registers the following monitoring endpoints
@@ -55,7 +54,7 @@ public class MetricsIOMonitor extends IO
private final TimerStats segmentReadTime;
private final TimerStats segmentWriteTime;
- public MetricsIOMonitor(@Nonnull StatisticsProvider statisticsProvider) {
+ public MetricsIOMonitor(@NotNull StatisticsProvider statisticsProvider) {
segmentReadBytes = statisticsProvider.getMeter(
OAK_SEGMENT_SEGMENT_READ_BYTES, StatsOptions.METRICS_ONLY);
segmentWriteBytes = statisticsProvider.getMeter(
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PrefixedGCListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PrefixedGCListener.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PrefixedGCListener.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PrefixedGCListener.java Wed Jul 18 15:02:27 2018
@@ -20,9 +20,8 @@ package org.apache.jackrabbit.oak.segmen
import java.util.concurrent.atomic.AtomicInteger;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
+import org.jetbrains.annotations.NotNull;
/**
* A {@link GCListener} that adds a prefix to every log message and delegates to
@@ -45,12 +44,12 @@ class PrefixedGCListener implements GCLi
}
@Override
- public void compactionSucceeded(@Nonnull GCGeneration newGeneration) {
+ public void compactionSucceeded(@NotNull GCGeneration newGeneration) {
listener.compactionSucceeded(newGeneration);
}
@Override
- public void compactionFailed(@Nonnull GCGeneration failedGeneration) {
+ public void compactionFailed(@NotNull GCGeneration failedGeneration) {
listener.compactionFailed(failedGeneration);
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PriorityCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PriorityCache.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PriorityCache.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/PriorityCache.java Wed Jul 18 15:02:27 2018
@@ -27,10 +27,9 @@ import static java.lang.Long.numberOfLea
import static java.lang.Math.max;
import static java.util.Arrays.fill;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.oak.segment.CacheWeights;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
@@ -70,7 +69,7 @@ public class PriorityCache<K, V> {
private long evictionCount;
private long size;
- @Nonnull
+ @NotNull
private final Weigher<K, V> weigher;
private long weight = 0;
@@ -79,7 +78,7 @@ public class PriorityCache<K, V> {
* @param size size of the cache. Must be a power of 2.
* @return a new {@code PriorityCache} instance of the given {@code size}.
*/
- public static <K, V> Supplier<PriorityCache<K, V>> factory(final int size, @Nonnull final Weigher<K, V> weigher) {
+ public static <K, V> Supplier<PriorityCache<K, V>> factory(final int size, @NotNull final Weigher<K, V> weigher) {
checkArgument(bitCount(size) == 1);
checkNotNull(weigher);
return new Supplier<PriorityCache<K, V>>() {
@@ -156,7 +155,7 @@ public class PriorityCache<K, V> {
* smaller than {@code 32 - numberOfTrailingZeros(size)}.
* @param weigher Needed to provide an estimation of the cache weight in memory
*/
- public PriorityCache(int size, int rehash, @Nonnull Weigher<K, V> weigher) {
+ public PriorityCache(int size, int rehash, @NotNull Weigher<K, V> weigher) {
checkArgument(bitCount(size) == 1);
checkArgument(rehash >= 0);
checkArgument(rehash < 32 - numberOfTrailingZeros(size));
@@ -171,7 +170,7 @@ public class PriorityCache<K, V> {
* the maximum number allowed by the given {@code size}. ({@code 31 - numberOfTrailingZeros(size)}.
* @param size Size of the cache. Must be a power of {@code 2}.
*/
- public PriorityCache(int size, @Nonnull Weigher<K, V> weigher) {
+ public PriorityCache(int size, @NotNull Weigher<K, V> weigher) {
this(size, 31 - numberOfTrailingZeros(size), weigher);
}
@@ -198,7 +197,7 @@ public class PriorityCache<K, V> {
* @param initialCost the initial cost associated with this mapping
* @return {@code true} if the mapping has been added, {@code false} otherwise.
*/
- public synchronized boolean put(@Nonnull K key, @Nonnull V value, int generation, byte initialCost) {
+ public synchronized boolean put(@NotNull K key, @NotNull V value, int generation, byte initialCost) {
int hashCode = key.hashCode();
byte cheapest = initialCost;
int index = -1;
@@ -265,8 +264,8 @@ public class PriorityCache<K, V> {
* cache does not contain such a mapping.
*/
@SuppressWarnings("unchecked")
- @CheckForNull
- public synchronized V get(@Nonnull K key, int generation) {
+ @Nullable
+ public synchronized V get(@NotNull K key, int generation) {
int hashCode = key.hashCode();
for (int k = 0; k <= rehash; k++) {
int i = project(hashCode, k);
@@ -290,7 +289,7 @@ public class PriorityCache<K, V> {
* passed {@code purge} predicate.
* @param purge
*/
- public synchronized void purgeGenerations(@Nonnull Predicate<Integer> purge) {
+ public synchronized void purgeGenerations(@NotNull Predicate<Integer> purge) {
for (int i = 0; i < entries.length; i++) {
Entry<?, ?> entry = entries[i];
if (entry != Entry.NULL && purge.apply(entry.generation)) {
@@ -328,7 +327,7 @@ public class PriorityCache<K, V> {
/**
* @return access statistics for this cache
*/
- @Nonnull
+ @NotNull
public CacheStats getStats() {
return new CacheStats(hitCount, missCount, loadCount, loadExceptionCount, 0, evictionCount);
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyFileStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyFileStore.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyFileStore.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyFileStore.java Wed Jul 18 15:02:27 2018
@@ -29,8 +29,6 @@ import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
-import javax.annotation.Nonnull;
-
import com.google.common.io.Closer;
import com.google.common.util.concurrent.UncheckedExecutionException;
import org.apache.jackrabbit.oak.segment.RecordId;
@@ -38,6 +36,7 @@ import org.apache.jackrabbit.oak.segment
import org.apache.jackrabbit.oak.segment.SegmentId;
import org.apache.jackrabbit.oak.segment.SegmentWriter;
import org.apache.jackrabbit.oak.segment.file.tar.TarFiles;
+import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,7 +53,7 @@ public class ReadOnlyFileStore extends A
private final TarFiles tarFiles;
- @Nonnull
+ @NotNull
private final SegmentWriter writer;
private ReadOnlyRevisions revisions;
@@ -80,7 +79,7 @@ public class ReadOnlyFileStore extends A
memoryMapping);
}
- ReadOnlyFileStore bind(@Nonnull ReadOnlyRevisions revisions) throws IOException {
+ ReadOnlyFileStore bind(@NotNull ReadOnlyRevisions revisions) throws IOException {
this.revisions = revisions;
this.revisions.bind(this, tracker);
currentHead = revisions.getHead();
@@ -110,7 +109,7 @@ public class ReadOnlyFileStore extends A
}
@Override
- @Nonnull
+ @NotNull
public Segment readSegment(final SegmentId id) {
try {
return segmentCache.getSegment(id, new Callable<Segment>() {
@@ -134,7 +133,7 @@ public class ReadOnlyFileStore extends A
log.info("TarMK closed: {}", directory);
}
- @Nonnull
+ @NotNull
@Override
public SegmentWriter getWriter() {
return writer;
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyRevisions.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyRevisions.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyRevisions.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/ReadOnlyRevisions.java Wed Jul 18 15:02:27 2018
@@ -26,8 +26,6 @@ import java.io.Closeable;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Function;
import org.apache.jackrabbit.oak.segment.RecordId;
import org.apache.jackrabbit.oak.segment.Revisions;
@@ -35,16 +33,17 @@ import org.apache.jackrabbit.oak.segment
import org.apache.jackrabbit.oak.segment.spi.persistence.JournalFile;
import org.apache.jackrabbit.oak.segment.spi.persistence.SegmentNodeStorePersistence;
import org.apache.jackrabbit.oak.segment.SegmentStore;
+import org.jetbrains.annotations.NotNull;
public class ReadOnlyRevisions implements Revisions, Closeable {
- @Nonnull
+ @NotNull
private final AtomicReference<RecordId> head;
- @Nonnull
+ @NotNull
private final JournalFile journalFile;
- public ReadOnlyRevisions(@Nonnull SegmentNodeStorePersistence persistence) {
+ public ReadOnlyRevisions(@NotNull SegmentNodeStorePersistence persistence) {
this.journalFile = checkNotNull(persistence).getJournalFile();
this.head = new AtomicReference<>(null);
}
@@ -56,7 +55,7 @@ public class ReadOnlyRevisions implement
* @param idProvider {@code SegmentIdProvider} of the {@code store}
* @throws IOException
*/
- synchronized void bind(@Nonnull SegmentStore store, @Nonnull SegmentIdProvider idProvider)
+ synchronized void bind(@NotNull SegmentStore store, @NotNull SegmentIdProvider idProvider)
throws IOException {
if (head.get() != null) {
return;
@@ -72,21 +71,21 @@ public class ReadOnlyRevisions implement
checkState(head.get() != null, "Revisions not bound to a store");
}
- @Nonnull
+ @NotNull
@Override
public RecordId getHead() {
checkBound();
return head.get();
}
- @Nonnull
+ @NotNull
@Override
public RecordId getPersistedHead() {
return getHead();
}
@Override
- public boolean setHead(@Nonnull RecordId expected, @Nonnull RecordId head, @Nonnull Option... options) {
+ public boolean setHead(@NotNull RecordId expected, @NotNull RecordId head, @NotNull Option... options) {
checkBound();
RecordId id = this.head.get();
return id.equals(expected) && this.head.compareAndSet(id, head);
@@ -94,8 +93,8 @@ public class ReadOnlyRevisions implement
@Override
public RecordId setHead(
- @Nonnull Function<RecordId, RecordId> newHead,
- @Nonnull Option... options) throws InterruptedException {
+ @NotNull Function<RecordId, RecordId> newHead,
+ @NotNull Option... options) throws InterruptedException {
throw new UnsupportedOperationException("ReadOnly Revisions");
}
Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/Reclaimers.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/Reclaimers.java?rev=1836191&r1=1836190&r2=1836191&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/Reclaimers.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/Reclaimers.java Wed Jul 18 15:02:27 2018
@@ -19,11 +19,10 @@ package org.apache.jackrabbit.oak.segmen
import static com.google.common.base.Preconditions.checkNotNull;
-import javax.annotation.Nonnull;
-
import com.google.common.base.Predicate;
import org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.GCType;
import org.apache.jackrabbit.oak.segment.file.tar.GCGeneration;
+import org.jetbrains.annotations.NotNull;
/**
* Helper class exposing static factories for reclaimers. A reclaimer
@@ -59,8 +58,8 @@ class Reclaimers {
* @param retainedGenerations number of generations to retain.
*/
static Predicate<GCGeneration> newOldReclaimer(
- @Nonnull GCType lastGCType,
- @Nonnull final GCGeneration referenceGeneration,
+ @NotNull GCType lastGCType,
+ @NotNull final GCGeneration referenceGeneration,
int retainedGenerations) {
switch (checkNotNull(lastGCType)) {
@@ -74,7 +73,7 @@ class Reclaimers {
}
private static Predicate<GCGeneration> newOldFullReclaimer(
- @Nonnull final GCGeneration referenceGeneration,
+ @NotNull final GCGeneration referenceGeneration,
int retainedGenerations) {
return new Predicate<GCGeneration>() {
@@ -104,7 +103,7 @@ class Reclaimers {
}
private static Predicate<GCGeneration> newOldTailReclaimer(
- @Nonnull final GCGeneration referenceGeneration,
+ @NotNull final GCGeneration referenceGeneration,
int retainedGenerations) {
return new Predicate<GCGeneration>() {
@@ -141,7 +140,7 @@ class Reclaimers {
* @return an new instance of an exact reclaimer for segments with their generation
* matching {@code referenceGeneration}.
*/
- static Predicate<GCGeneration> newExactReclaimer(@Nonnull final GCGeneration referenceGeneration) {
+ static Predicate<GCGeneration> newExactReclaimer(@NotNull final GCGeneration referenceGeneration) {
return new Predicate<GCGeneration>() {
@Override
public boolean apply(GCGeneration generation) {