Skip to content

Commit 184fd96

Browse files
committed
Merge branch 'master' into concurrent-reindex
2 parents a1dd433 + 449d8e3 commit 184fd96

File tree

9 files changed

+576
-242
lines changed

9 files changed

+576
-242
lines changed

checkstyle/src/main/resources/checkstyle.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<module name="RegexpSinglelineJava">
7979
<property name="format" value=" StringBuffer" />
8080
<!-- The last sentence of the message is a keyword to trigger exclusion: see ExcludeTestPackages -->
81-
<property name="message" value="Nobody should be using StringBuffer anymore" />
81+
<property name="message" value="Nobody should be using StringBuffer anymore [not required for tests]" />
8282
</module>
8383
<module name="IllegalInstantiation">
8484
<property name="classes" value="java.lang.Boolean"/>
@@ -166,4 +166,4 @@
166166
<!-- Allow for some code sanity rules to be violated by test code -->
167167
<module name="org.modeshape.checkstyle.ExcludeTestPackages" />
168168

169-
</module>
169+
</module>

modeshape-jcr/src/main/java/org/modeshape/jcr/JcrI18n.java

+2
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ public final class JcrI18n {
436436
public static I18n upgrade4_0_0_Alpha1_Failed;
437437
public static I18n upgrade4_0_0_Beta3_Running;
438438
public static I18n upgrade4_0_0_Beta3_Failed;
439+
public static I18n upgrade5_5_0_Running;
440+
public static I18n upgrade5_5_0_Failed;
439441

440442
public static I18n cannotStartJournal;
441443
public static I18n cannotStopJournal;

modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryConfiguration.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ public static class FieldName {
437437
public static final String PORT = "port";
438438
public static final String BUCKET_NAME = "bucketName";
439439
public static final String ENDPOINT_URL = "endPoint";
440+
public static final String DELETE_UNUSED_NATIVELY = "deleteUnusedNatively";
440441

441442
public static final String GARBAGE_COLLECTION = "garbageCollection";
442443
public static final String INITIAL_TIME = "initialTime";
@@ -1210,7 +1211,8 @@ public BinaryStore getBinaryStore() throws Exception {
12101211
String password = binaryStorage.getString(FieldName.USER_PASSWORD);
12111212
String bucketName = binaryStorage.getString(FieldName.BUCKET_NAME);
12121213
String endPoint = binaryStorage.getString(FieldName.ENDPOINT_URL);
1213-
store = new S3BinaryStore(username, password, bucketName, endPoint);
1214+
Boolean deleteUnusedNatively = binaryStorage.getBoolean(FieldName.DELETE_UNUSED_NATIVELY);
1215+
store = new S3BinaryStore(username, password, bucketName, endPoint, deleteUnusedNatively);
12141216
}
12151217

12161218
if (store == null) store = TransientBinaryStore.get();

modeshape-jcr/src/main/java/org/modeshape/jcr/Upgrades.java

+25-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.modeshape.jcr.value.binary.BinaryStore;
3636
import org.modeshape.jcr.value.binary.BinaryStoreException;
3737
import org.modeshape.jcr.value.binary.FileSystemBinaryStore;
38+
import org.modeshape.jcr.value.binary.S3BinaryStore;
3839

3940
/**
4041
* @author Randall Hauch ([email protected])
@@ -67,7 +68,8 @@ public static interface Context {
6768
public static final Upgrades STANDARD_UPGRADES;
6869

6970
static {
70-
STANDARD_UPGRADES = new Upgrades(ModeShape_3_6_0.INSTANCE, ModeShape_4_0_0_Alpha1.INSTANCE, ModeShape_4_0_0_Beta3.INSTANCE);
71+
STANDARD_UPGRADES = new Upgrades(ModeShape_3_6_0.INSTANCE, ModeShape_4_0_0_Alpha1.INSTANCE,
72+
ModeShape_4_0_0_Beta3.INSTANCE, ModeShape_5_5_0.INSTANCE);
7173
}
7274

7375
private final List<UpgradeOperation> operations = new ArrayList<>();
@@ -309,4 +311,26 @@ public void apply( Context resources ) {
309311
}
310312
}
311313
}
314+
315+
protected static class ModeShape_5_5_0 extends UpgradeOperation {
316+
protected static final UpgradeOperation INSTANCE = new ModeShape_5_5_0();
317+
318+
protected ModeShape_5_5_0() {
319+
super(550);
320+
}
321+
322+
@Override
323+
public void apply( Context resources ) {
324+
LOGGER.info(JcrI18n.upgrade5_5_0_Running);
325+
RunningState runningState = resources.getRepository();
326+
BinaryStore binaryStore = runningState.binaryStore();
327+
try {
328+
if (binaryStore instanceof S3BinaryStore) {
329+
((S3BinaryStore)binaryStore).migrateUnusedMetadataToTags();
330+
}
331+
} catch (BinaryStoreException e) {
332+
LOGGER.error(e, JcrI18n.upgrade5_5_0_Failed, e.getMessage());
333+
}
334+
}
335+
}
312336
}

0 commit comments

Comments
 (0)