Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/blob/AbstractBlobTrackerRegistrationTest.java
===================================================================
--- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/blob/AbstractBlobTrackerRegistrationTest.java (revision 1773023)
+++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/blob/AbstractBlobTrackerRegistrationTest.java (working copy)
@@ -19,6 +19,12 @@
package org.apache.jackrabbit.oak.plugins.blob;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import javax.annotation.Nullable;
@@ -40,12 +46,6 @@
import org.junit.rules.TemporaryFolder;
import org.osgi.framework.ServiceRegistration;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
/**
* Tests OSGi registration for {@link BlobTrackingStore}.
*/
@@ -72,9 +72,8 @@
@Test
public void registerBlobTrackingStore() throws Exception {
+ registerTrackingBlobStore();
registerNodeStoreService();
- assertServiceNotActivated();
- registerTrackingBlobStore();
assertServiceActivated();
BlobStore blobStore = context.getService(BlobStore.class);
@@ -86,9 +85,8 @@
@Test
public void reRegisterBlobTrackingStore() throws Exception {
+ registerTrackingBlobStore();
registerNodeStoreService();
- assertServiceNotActivated();
- registerTrackingBlobStore();
assertServiceActivated();
BlobStore blobStore = context.getService(BlobStore.class);
Index: oak-pojosr/pom.xml
===================================================================
--- oak-pojosr/pom.xml (revision 1773023)
+++ oak-pojosr/pom.xml (working copy)
@@ -94,6 +94,11 @@
org.apache.jackrabbit
+ oak-segment-tar
+ ${project.version}
+
+
+ org.apache.jackrabbit
oak-jcr
${project.version}
Index: oak-pojosr/src/main/java/org/apache/jackrabbit/oak/run/osgi/OakOSGiRepositoryFactory.java
===================================================================
--- oak-pojosr/src/main/java/org/apache/jackrabbit/oak/run/osgi/OakOSGiRepositoryFactory.java (revision 1773023)
+++ oak-pojosr/src/main/java/org/apache/jackrabbit/oak/run/osgi/OakOSGiRepositoryFactory.java (working copy)
@@ -19,6 +19,8 @@
package org.apache.jackrabbit.oak.run.osgi;
+import static com.google.common.base.Preconditions.checkNotNull;
+
import java.lang.management.ManagementFactory;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
@@ -64,8 +66,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static com.google.common.base.Preconditions.checkNotNull;
-
/**
* RepositoryFactory which constructs an instance of Oak repository. Thi factory supports following
* parameters
@@ -133,12 +133,15 @@
public static final String REPOSITORY_ENV_SPRING_BOOT =
"org.apache.jackrabbit.oak.repository.springBootMode";
- public static final String REPOSITORY_BUNDLE_FILTER_DEFAULT = "(|" +
+ public static final String REPOSITORY_BUNDLE_FILTER_DEFAULT = "(&" +
+ "(|" +
"(Bundle-SymbolicName=org.apache.jackrabbit*)" +
"(Bundle-SymbolicName=org.apache.sling*)" +
"(Bundle-SymbolicName=org.apache.felix*)" +
"(Bundle-SymbolicName=org.apache.aries*)" +
"(Bundle-SymbolicName=groovy-all)" +
+ ")" +
+ "(!(Bundle-SymbolicName=org.apache.jackrabbit.oak-segment-tar))" +
")";
/**
Index: oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/TarSegmentNodeStoreConfigTest.groovy
===================================================================
--- oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/TarSegmentNodeStoreConfigTest.groovy (nonexistent)
+++ oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/TarSegmentNodeStoreConfigTest.groovy (working copy)
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.oak.run.osgi
+
+import org.apache.felix.connect.launch.PojoServiceRegistry
+import org.apache.jackrabbit.oak.spi.blob.BlobStore
+import org.apache.jackrabbit.oak.spi.state.NodeStore
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertNull
+import static org.mockito.Mockito.mock
+
+class TarSegmentNodeStoreConfigTest extends AbstractRepositoryFactoryTest {
+
+ private static final String SEGMENT_TAR_BUNDLE_FILTER = "(&" +
+ "(|" +
+ "(Bundle-SymbolicName=org.apache.jackrabbit*)" +
+ "(Bundle-SymbolicName=org.apache.sling*)" +
+ "(Bundle-SymbolicName=org.apache.felix*)" +
+ "(Bundle-SymbolicName=org.apache.aries*)" +
+ "(Bundle-SymbolicName=groovy-all)" +
+ ")" +
+ "(!(Bundle-SymbolicName=org.apache.jackrabbit.oak-segment))" +
+ ")"
+
+ private PojoServiceRegistry registry
+
+ @Before
+ void adjustConfig() {
+ config[OakOSGiRepositoryFactory.REPOSITORY_BUNDLE_FILTER] = SEGMENT_TAR_BUNDLE_FILTER
+ registry = repositoryFactory.initializeServiceRegistry(config)
+ }
+
+ @Override
+ protected PojoServiceRegistry getRegistry() {
+ return registry
+ }
+
+ @Test
+ void testDynamicBlobStore() {
+ createConfig([
+ 'org.apache.jackrabbit.oak.segment.SegmentNodeStoreService': [
+ "customBlobStore": true
+ ]
+ ])
+ assertNull(registry.getServiceReference(NodeStore.class.name))
+ def registration = registry.registerService(BlobStore.class.name, mock(BlobStore.class), null)
+ assertNotNull(getServiceWithWait(NodeStore.class))
+ registration.unregister()
+ assertNull(registry.getServiceReference(NodeStore.class.name))
+ }
+
+}
Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentStoreProvider.java
===================================================================
--- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentStoreProvider.java (nonexistent)
+++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentStoreProvider.java (working copy)
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.oak.segment;
+
+/**
+ * A {@link SegmentStoreProvider} that returns a {@link SegmentStore} instance
+ * provided by the user.
+ */
+class DefaultSegmentStoreProvider implements SegmentStoreProvider {
+
+ private final SegmentStore segmentStore;
+
+ DefaultSegmentStoreProvider(SegmentStore segmentStore) {
+ this.segmentStore = segmentStore;
+ }
+
+ @Override
+ public SegmentStore getSegmentStore() {
+ return segmentStore;
+ }
+
+}
Property changes on: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentStoreProvider.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java
===================================================================
--- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java (revision 1773023)
+++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreService.java (working copy)
@@ -18,7 +18,6 @@
*/
package org.apache.jackrabbit.oak.segment;
-import static com.google.common.base.Preconditions.checkState;
import static java.util.Collections.emptyMap;
import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toBoolean;
import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toInteger;
@@ -25,6 +24,7 @@
import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toLong;
import static org.apache.jackrabbit.oak.osgi.OsgiUtil.lookupConfigurationThenFramework;
import static org.apache.jackrabbit.oak.segment.SegmentNotFoundExceptionListener.IGNORE_SNFE;
+import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.DISABLE_ESTIMATION_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.FORCE_TIMEOUT_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.GC_PROGRESS_LOG_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.MEMORY_THRESHOLD_DEFAULT;
@@ -32,13 +32,11 @@
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.RETAINED_GENERATIONS_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.RETRY_COUNT_DEFAULT;
import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.SIZE_DELTA_ESTIMATION_DEFAULT;
-import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.DISABLE_ESTIMATION_DEFAULT;
import static org.apache.jackrabbit.oak.segment.file.FileStoreBuilder.fileStoreBuilder;
import static org.apache.jackrabbit.oak.spi.blob.osgi.SplitBlobStoreService.ONLY_STANDALONE_TARGET;
import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.registerMBean;
import java.io.ByteArrayInputStream;
-import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -48,6 +46,8 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
+import com.google.common.base.Strings;
+import com.google.common.base.Supplier;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.ConfigurationPolicy;
@@ -56,6 +56,7 @@
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.ReferencePolicy;
+import org.apache.felix.scr.annotations.ReferencePolicyOption;
import org.apache.jackrabbit.commons.SimpleValueFactory;
import org.apache.jackrabbit.oak.api.Descriptors;
import org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean;
@@ -85,12 +86,9 @@
import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
import org.apache.jackrabbit.oak.spi.blob.BlobStore;
import org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore;
-import org.apache.jackrabbit.oak.spi.commit.Observable;
-import org.apache.jackrabbit.oak.spi.commit.Observer;
import org.apache.jackrabbit.oak.spi.gc.GCMonitor;
import org.apache.jackrabbit.oak.spi.gc.GCMonitorTracker;
import org.apache.jackrabbit.oak.spi.state.NodeStore;
-import org.apache.jackrabbit.oak.spi.state.ProxyNodeStore;
import org.apache.jackrabbit.oak.spi.state.RevisionGC;
import org.apache.jackrabbit.oak.spi.state.RevisionGCMBean;
import org.apache.jackrabbit.oak.spi.whiteboard.CompositeRegistration;
@@ -105,9 +103,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Strings;
-import com.google.common.base.Supplier;
-
/**
* An OSGi wrapper for the segment node store.
*/
@@ -120,11 +115,8 @@
"should be done via file system based config file and this view should ONLY be used to determine which " +
"options are supported"
)
-public class SegmentNodeStoreService extends ProxyNodeStore
- implements Observable, SegmentStoreProvider {
+public class SegmentNodeStoreService {
- public static final String NAME = "name";
-
@Property(
label = "Directory",
description="Directory location used to store the segment tar files. If not specified then looks " +
@@ -273,12 +265,8 @@
private final Logger log = LoggerFactory.getLogger(getClass());
- private String name;
-
private FileStore store;
- private volatile SegmentNodeStore segmentNodeStore;
-
private ObserverTracker observerTracker;
private GCMonitorTracker gcMonitor;
@@ -285,8 +273,12 @@
private ComponentContext context;
- @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY,
- policy = ReferencePolicy.DYNAMIC, target = ONLY_STANDALONE_TARGET)
+ @Reference(
+ cardinality = ReferenceCardinality.OPTIONAL_UNARY,
+ policy = ReferencePolicy.STATIC,
+ policyOption = ReferencePolicyOption.GREEDY,
+ target = ONLY_STANDALONE_TARGET
+ )
private volatile BlobStore blobStore;
@Reference
@@ -325,12 +317,6 @@
)
public static final String PROP_BLOB_SNAPSHOT_INTERVAL = "blobTrackSnapshotIntervalInSecs";
- @Override
- protected SegmentNodeStore getNodeStore() {
- checkState(segmentNodeStore != null, "service must be activated when used");
- return segmentNodeStore;
- }
-
@Activate
public void activate(ComponentContext context) throws IOException {
this.context = context;
@@ -338,60 +324,9 @@
if (blobStore == null && customBlobStore) {
log.info("BlobStore use enabled. SegmentNodeStore would be initialized when BlobStore would be available");
- } else {
- registerNodeStore();
- }
- }
-
- protected void bindBlobStore(BlobStore blobStore) throws IOException {
- this.blobStore = blobStore;
- registerNodeStore();
- }
-
- protected void unbindBlobStore(BlobStore blobStore){
- this.blobStore = null;
- unregisterNodeStore();
- }
-
- @Deactivate
- public void deactivate() {
- unregisterNodeStore();
-
- synchronized (this) {
- if (observerTracker != null) {
- observerTracker.stop();
- }
- if (gcMonitor != null) {
- gcMonitor.stop();
- }
- segmentNodeStore = null;
-
- if (store != null) {
- store.close();
- store = null;
- }
- }
- }
-
- private synchronized void registerNodeStore() throws IOException {
- if (!registerSegmentStore()) {
return;
}
- if (toBoolean(property(STANDBY), false)) {
- return;
- }
- Dictionary props = new Hashtable();
- props.put(Constants.SERVICE_PID, SegmentNodeStore.class.getName());
- props.put("oak.nodestore.description", new String[] {"nodeStoreType=segment"});
- storeRegistration = context.getBundleContext().registerService(NodeStore.class.getName(), this, props);
- }
- private boolean registerSegmentStore() throws IOException {
- if (context == null) {
- log.info("Component still not activated. Ignoring the initialization call");
- return false;
- }
-
OsgiWhiteboard whiteboard = new OsgiWhiteboard(context.getBundleContext());
// Listen for GCMonitor services
@@ -420,7 +355,7 @@
log.info("Initializing SegmentNodeStore with BlobStore [{}]", blobStore);
builder.withBlobStore(blobStore);
}
-
+
if (toBoolean(property(STANDBY), true)) {
builder.withSnfeListener(IGNORE_SNFE);
}
@@ -429,7 +364,7 @@
store = builder.build();
} catch (InvalidFileStoreVersionException e) {
log.error("The segment store data is not compatible with the current version. Please use oak-segment or a different version of oak-segment-tar.");
- return false;
+ return;
}
// Expose stats about the segment cache
@@ -449,7 +384,7 @@
registrations.add(registerMBean(
whiteboard,
CacheStatsMBean.class,
- stringCacheStats,CacheStats.TYPE,
+ stringCacheStats, CacheStats.TYPE,
stringCacheStats.getName()
));
@@ -457,7 +392,7 @@
registrations.add(registerMBean(
whiteboard,
CacheStatsMBean.class,
- templateCacheStats,CacheStats.TYPE,
+ templateCacheStats, CacheStats.TYPE,
templateCacheStats.getName()
));
@@ -464,28 +399,28 @@
CacheStatsMBean stringDeduplicationCacheStats = store.getStringDeduplicationCacheStats();
if (stringDeduplicationCacheStats != null) {
registrations.add(registerMBean(
- whiteboard,
- CacheStatsMBean.class,
- stringDeduplicationCacheStats,CacheStats.TYPE,
- stringDeduplicationCacheStats.getName()));
+ whiteboard,
+ CacheStatsMBean.class,
+ stringDeduplicationCacheStats, CacheStats.TYPE,
+ stringDeduplicationCacheStats.getName()));
}
CacheStatsMBean templateDeduplicationCacheStats = store.getTemplateDeduplicationCacheStats();
if (templateDeduplicationCacheStats != null) {
registrations.add(registerMBean(
- whiteboard,
- CacheStatsMBean.class,
- templateDeduplicationCacheStats,CacheStats.TYPE,
- templateDeduplicationCacheStats.getName()));
+ whiteboard,
+ CacheStatsMBean.class,
+ templateDeduplicationCacheStats, CacheStats.TYPE,
+ templateDeduplicationCacheStats.getName()));
}
CacheStatsMBean nodeDeduplicationCacheStats = store.getNodeDeduplicationCacheStats();
if (nodeDeduplicationCacheStats != null) {
registrations.add(registerMBean(
- whiteboard,
- CacheStatsMBean.class,
- nodeDeduplicationCacheStats,CacheStats.TYPE,
- nodeDeduplicationCacheStats.getName()));
+ whiteboard,
+ CacheStatsMBean.class,
+ nodeDeduplicationCacheStats, CacheStats.TYPE,
+ nodeDeduplicationCacheStats.getName()));
}
// Listen for Executor services on the whiteboard
@@ -497,16 +432,17 @@
final FileStoreGCMonitor fsgcm = new FileStoreGCMonitor(Clock.SIMPLE);
registrations.add(new CompositeRegistration(
- whiteboard.register(GCMonitor.class, fsgcm, emptyMap()),
- registerMBean(
- whiteboard,
- SegmentRevisionGC.class,
- new SegmentRevisionGCMBean(store, gcOptions, fsgcm),
- SegmentRevisionGC.TYPE,
- "Segment node store revision garbage collection"
- )));
+ whiteboard.register(GCMonitor.class, fsgcm, emptyMap()),
+ registerMBean(
+ whiteboard,
+ SegmentRevisionGC.class,
+ new SegmentRevisionGCMBean(store, gcOptions, fsgcm),
+ SegmentRevisionGC.TYPE,
+ "Segment node store revision garbage collection"
+ )));
Runnable cancelGC = new Runnable() {
+
@Override
public void run() {
store.cancelGC();
@@ -513,6 +449,7 @@
}
};
Supplier statusMessage = new Supplier() {
+
@Override
public String get() {
return fsgcm.getStatus();
@@ -538,18 +475,15 @@
// register segment node store
- Dictionary, ?> properties = context.getProperties();
- name = String.valueOf(properties.get(NAME));
-
final long blobGcMaxAgeInSecs = toLong(property(PROP_BLOB_GC_MAX_AGE), DEFAULT_BLOB_GC_MAX_AGE);
SegmentNodeStore.SegmentNodeStoreBuilder segmentNodeStoreBuilder =
SegmentNodeStoreBuilders.builder(store)
- .withStatisticsProvider(statisticsProvider);
+ .withStatisticsProvider(statisticsProvider);
if (toBoolean(property(STANDBY), false)) {
segmentNodeStoreBuilder.dispatchChanges(false);
}
- segmentNodeStore = segmentNodeStoreBuilder.build();
+ SegmentNodeStore segmentNodeStore = segmentNodeStoreBuilder.build();
observerTracker = new ObserverTracker(segmentNodeStore);
observerTracker.start(context.getBundleContext());
@@ -622,18 +556,18 @@
"Segment node store blob garbage collection"
));
}
-
+
// Expose an MBean for backup/restore operations
-
+
registrations.add(registerMBean(
whiteboard,
FileStoreBackupRestoreMBean.class,
- new FileStoreBackupRestoreImpl(segmentNodeStore, store.getRevisions(), store.getReader(), getBackupDirectory(), executor),
+ new FileStoreBackupRestoreImpl(segmentNodeStore, store.getRevisions(), store.getReader(), getBackupDirectory(), executor),
FileStoreBackupRestoreMBean.TYPE, "Segment node store backup/restore"
));
// Expose statistics about the SegmentNodeStore
-
+
registrations.add(registerMBean(
whiteboard,
SegmentNodeStoreStatsMBean.class,
@@ -641,16 +575,57 @@
SegmentNodeStoreStatsMBean.TYPE,
"SegmentNodeStore statistics"
));
-
+
log.info("SegmentNodeStore initialized");
// Register a factory service to expose the FileStore
- providerRegistration = context.getBundleContext().registerService(SegmentStoreProvider.class.getName(), this, null);
+ providerRegistration = context.getBundleContext().registerService(
+ SegmentStoreProvider.class.getName(),
+ new DefaultSegmentStoreProvider(store),
+ null
+ );
- return true;
+ if (toBoolean(property(STANDBY), false)) {
+ return;
+ }
+
+ Dictionary props = new Hashtable();
+ props.put(Constants.SERVICE_PID, SegmentNodeStore.class.getName());
+ props.put("oak.nodestore.description", new String[] {"nodeStoreType=segment"});
+ storeRegistration = context.getBundleContext().registerService(NodeStore.class.getName(), segmentNodeStore, props);
}
+ @Deactivate
+ public void deactivate() {
+ new CompositeRegistration(registrations).unregister();
+ registrations.clear();
+ if (providerRegistration != null) {
+ providerRegistration.unregister();
+ providerRegistration = null;
+ }
+ if (storeRegistration != null) {
+ storeRegistration.unregister();
+ storeRegistration = null;
+ }
+ if (executor != null) {
+ executor.stop();
+ executor = null;
+ }
+ if (observerTracker != null) {
+ observerTracker.stop();
+ observerTracker = null;
+ }
+ if (gcMonitor != null) {
+ gcMonitor.stop();
+ gcMonitor = null;
+ }
+ if (store != null) {
+ store.close();
+ store = null;
+ }
+ }
+
private SegmentGCOptions newGCOptions() {
boolean pauseCompaction = toBoolean(property(PAUSE_COMPACTION), PAUSE_DEFAULT);
int retryCount = toInteger(property(COMPACTION_RETRY_COUNT), RETRY_COUNT_DEFAULT);
@@ -675,22 +650,6 @@
.withGCNodeWriteMonitor(gcProgressLog);
}
- private void unregisterNodeStore() {
- new CompositeRegistration(registrations).unregister();
- if (providerRegistration != null) {
- providerRegistration.unregister();
- providerRegistration = null;
- }
- if (storeRegistration != null) {
- storeRegistration.unregister();
- storeRegistration = null;
- }
- if (executor != null) {
- executor.stop();
- executor = null;
- }
- }
-
private File getBaseDirectory() {
String directory = property(DIRECTORY);
@@ -779,26 +738,4 @@
return lookupConfigurationThenFramework(context, name);
}
- /**
- * needed for situations where you have to unwrap the
- * SegmentNodeStoreService, to get the SegmentStore, like the failover
- */
- @Override
- public SegmentStore getSegmentStore() {
- return store;
- }
-
- //------------------------------------------------------------< Observable >---
-
- @Override
- public Closeable addObserver(Observer observer) {
- return getNodeStore().addObserver(observer);
- }
-
- //------------------------------------------------------------< Object >--
-
- @Override
- public String toString() {
- return name + ": " + segmentNodeStore;
- }
}
Index: oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreServiceTest.java
===================================================================
--- oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreServiceTest.java (revision 1773023)
+++ oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreServiceTest.java (working copy)
@@ -105,41 +105,6 @@
unregisterBlobStore();
}
- /**
- * A NodeStore service should be registered when the "customBlobStore"
- * configuration property is true and a BlobStore service becomes
- * dynamically available.
- */
- @Test
- public void testUseCustomBlobStoreWithDynamicBlobStoreActivation() {
- registerSegmentNodeStoreService(true);
- assertServiceNotActivated();
-
- registerBlobStore();
- assertServiceActivated();
-
- unregisterSegmentNodeStoreService();
- unregisterBlobStore();
- }
-
- /**
- * A NodeStore service should be unregistered when the "customBlobStore"
- * configuration property is true and a BlobStore service becomes
- * dynamically unavailable.
- */
- @Test
- public void testUseCustomBlobStoreWithDynamicBlobStoreDeactivation() {
- registerBlobStore();
-
- registerSegmentNodeStoreService(true);
- assertServiceActivated();
-
- unregisterBlobStore();
- assertServiceNotActivated();
-
- unregisterSegmentNodeStoreService();
- }
-
private SegmentNodeStoreService segmentNodeStoreService;
protected void registerSegmentNodeStoreService(boolean customBlobStore) {