public void fixed() { if (corruptIndexHandler.isFailing(name)){ log.info("[{}] Index update no longer fails but some corrupt indexes have been skipped {}", name, corruptIndexHandler.getCorruptIndexData(name).keySet()); } else { log.info("[{}] Index update no longer fails", name); } failing = false; failingSince = ""; consecutiveFailures = 0; latestErrorWarn = 0; latestError = null; latestErrorTime = ""; }
public void fixed() { if (corruptIndexHandler.isFailing(name)){ log.info("[{}] Index update no longer fails but some corrupt indexes have been skipped {}", name, corruptIndexHandler.getCorruptIndexData(name).keySet()); } else { log.info("[{}] Index update no longer fails", name); } failing = false; failingSince = ""; consecutiveFailures = 0; latestErrorWarn = 0; latestError = null; latestErrorTime = ""; }
public void fixed() { if (corruptIndexHandler.isFailing(name)){ log.info("[{}] Index update no longer fails but some corrupt indexes have been skipped {}", name, corruptIndexHandler.getCorruptIndexData(name).keySet()); } else { log.info("[{}] Index update no longer fails", name); } failing = false; failingSince = ""; consecutiveFailures = 0; latestErrorWarn = 0; latestError = null; latestErrorTime = ""; }
private void markFailingIndexesAsCorrupt(NodeBuilder builder) { for (Map.Entry<String, CorruptIndexInfo> index : corruptIndexHandler.getCorruptIndexData(name).entrySet()){ NodeBuilder indexBuilder = childBuilder(builder, index.getKey()); CorruptIndexInfo info = index.getValue(); if (!indexBuilder.hasProperty(IndexConstants.CORRUPT_PROPERTY_NAME)){ String corruptSince = ISO8601.format(info.getCorruptSinceAsCal()); indexBuilder.setProperty( PropertyStates.createProperty(IndexConstants.CORRUPT_PROPERTY_NAME, corruptSince, Type.DATE)); log.info("Marking [{}] as corrupt. The index is failing {}", info.getPath(), info.getStats()); } else { log.debug("Failing index at [{}] is already marked as corrupt. The index is failing {}", info.getPath(), info.getStats()); } } }
private void markFailingIndexesAsCorrupt(NodeBuilder builder) { for (Map.Entry<String, CorruptIndexInfo> index : corruptIndexHandler.getCorruptIndexData(name).entrySet()){ NodeBuilder indexBuilder = childBuilder(builder, index.getKey()); CorruptIndexInfo info = index.getValue(); if (!indexBuilder.hasProperty(IndexConstants.CORRUPT_PROPERTY_NAME)){ String corruptSince = ISO8601.format(info.getCorruptSinceAsCal()); indexBuilder.setProperty( PropertyStates.createProperty(IndexConstants.CORRUPT_PROPERTY_NAME, corruptSince, Type.DATE)); log.info("Marking [{}] as corrupt. The index is failing {}", info.getPath(), info.getStats()); } else { log.debug("Failing index at [{}] is already marked as corrupt. The index is failing {}", info.getPath(), info.getStats()); } } }
private void markFailingIndexesAsCorrupt(NodeBuilder builder) { for (Map.Entry<String, CorruptIndexInfo> index : corruptIndexHandler.getCorruptIndexData(name).entrySet()){ NodeBuilder indexBuilder = childBuilder(builder, index.getKey()); CorruptIndexInfo info = index.getValue(); if (!indexBuilder.hasProperty(IndexConstants.CORRUPT_PROPERTY_NAME)){ String corruptSince = ISO8601.format(info.getCorruptSinceAsCal()); indexBuilder.setProperty( PropertyStates.createProperty(IndexConstants.CORRUPT_PROPERTY_NAME, corruptSince, Type.DATE)); log.info("Marking [{}] as corrupt. The index is failing {}", info.getPath(), info.getStats()); } else { log.debug("Failing index at [{}] is already marked as corrupt. The index is failing {}", info.getPath(), info.getStats()); } } }
@Test public void basics() throws Exception{ handler.setClock(clock); handler.indexUpdateFailed("async", "/oak:index/foo", new Exception()); //Index would not be considered corrupt until timeout assertFalse(handler.getCorruptIndexData("async").containsKey("/oak:index/foo")); clock.waitUntil(clock.getTime() + handler.getCorruptIntervalMillis() + 1); assertTrue(handler.getCorruptIndexData("async").containsKey("/oak:index/foo")); //Should only be visible for "async" assertFalse(handler.getCorruptIndexData("async-fulltext").containsKey("/oak:index/foo")); handler.markWorkingIndexes(Collections.singleton("/oak:index/foo")); assertFalse(handler.getCorruptIndexData("async").containsKey("/oak:index/foo")); }
@Test public void disbaled() throws Exception{ handler.setClock(clock); handler.indexUpdateFailed("async", "/oak:index/foo", new Exception()); clock.waitUntil(clock.getTime() + handler.getCorruptIntervalMillis() + 1); assertTrue(handler.getCorruptIndexData("async").containsKey("/oak:index/foo")); handler.setCorruptInterval(0, TimeUnit.SECONDS); //With timeout set to zero no corrupt index should be reported assertFalse(handler.getCorruptIndexData("async").containsKey("/oak:index/foo")); }
assertFalse(async.getCorruptIndexHandler().getCorruptIndexData("async").containsKey("/oak:index/barIndex")); assertTrue(async.getCorruptIndexHandler().getCorruptIndexData("async").containsKey("/oak:index/barIndex"));