/** * Retries to get or create index file. * * @return {@link IndexFile} or null on failure. */ public IndexFile retryGetAndCreateIndexFile() { IndexFile indexFile = null; for (int times = 0; null == indexFile && times < MAX_TRY_IDX_CREATE; times++) { indexFile = this.getAndCreateLastIndexFile(); if (null != indexFile) break; try { log.info("Tried to create index file " + times + " times"); Thread.sleep(1000); } catch (InterruptedException e) { log.error("Interrupted", e); } } if (null == indexFile) { this.defaultMessageStore.getAccessRights().makeIndexFileError(); log.error("Mark index file cannot build flag"); } return indexFile; }
/** * Retries to get or create index file. * * @return {@link IndexFile} or null on failure. */ public IndexFile retryGetAndCreateIndexFile() { IndexFile indexFile = null; for (int times = 0; null == indexFile && times < MAX_TRY_IDX_CREATE; times++) { indexFile = this.getAndCreateLastIndexFile(); if (null != indexFile) break; try { log.info("Tried to create index file " + times + " times"); Thread.sleep(1000); } catch (InterruptedException e) { log.error("Interrupted", e); } } if (null == indexFile) { this.defaultMessageStore.getAccessRights().makeIndexFileError(); log.error("Mark index file cannot build flag"); } return indexFile; }
/** * Retries to get or create index file. * * @return {@link IndexFile} or null on failure. */ public IndexFile retryGetAndCreateIndexFile() { IndexFile indexFile = null; for (int times = 0; null == indexFile && times < MAX_TRY_IDX_CREATE; times++) { indexFile = this.getAndCreateLastIndexFile(); if (null != indexFile) break; try { log.info("Tried to create index file " + times + " times"); Thread.sleep(1000); } catch (InterruptedException e) { log.error("Interrupted", e); } } if (null == indexFile) { this.defaultMessageStore.getAccessRights().makeIndexFileError(); log.error("Mark index file cannot build flag"); } return indexFile; }