Service to provide access to async indexer state
Add a method to construct lastIndexedTo property
Add a method to check if given name is async name or not
@@ -207,7 +207,7 @@ public class AsyncIndexUpdate implements Runnable, Closeable {
public AsyncIndexUpdate(@Nonnull String name, @Nonnull NodeStore store,
@Nonnull IndexEditorProvider provider, StatisticsProvider statsProvider, boolean switchOnSync) {
this.name = checkValidName(name);
- this.lastIndexedTo = name + "-LastIndexedTo";
+ this.lastIndexedTo = lastIndexedTo(name);
this.store = checkNotNull(store);
this.provider = checkNotNull(provider);
this.switchOnSync = switchOnSync;
@@ -230,6 +230,10 @@ public class AsyncIndexUpdate implements Runnable, Closeable {
return asyncName;
}
+ public static boolean isAsyncLaneName(String asyncName){
+ return IndexConstants.ASYNC_REINDEX_VALUE.equals(asyncName) || asyncName.endsWith("async");
+ }
+
/**
* Index update callback that tries to raise the async status flag when
* the first index change is detected.
@@ -781,6 +785,10 @@ public class AsyncIndexUpdate implements Runnable, Closeable {
return name + "-lease";
}
+ static String lastIndexedTo(String name) {
+ return name + "-LastIndexedTo";
+ }
+
private static String getTempCpName(String name) {
return name + "-temp";
}
