/** * Check that the store usage limit is not greater than max usable * space and adjust if it is */ protected void checkStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); if (getPersistenceAdapter() != null) { PersistenceAdapter adapter = getPersistenceAdapter(); checkUsageLimit(adapter.getDirectory(), usage.getStoreUsage(), usage.getStoreUsage().getPercentLimit()); long maxJournalFileSize = 0; long storeLimit = usage.getStoreUsage().getLimit(); if (adapter instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) adapter).getJournalMaxFileLength(); } if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the store will not accept any data when used."); } } }
/** * Check that temporary usage limit is not greater than max usable * space and adjust if it is */ protected void checkTmpStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); File tmpDir = getTmpDataDirectory(); if (tmpDir != null) { checkUsageLimit(tmpDir, usage.getTempUsage(), usage.getTempUsage().getPercentLimit()); if (isPersistent()) { long maxJournalFileSize; PListStore store = usage.getTempUsage().getStore(); if (store != null && store instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) store).getJournalMaxFileLength(); } else { maxJournalFileSize = DEFAULT_MAX_FILE_LENGTH; } long storeLimit = usage.getTempUsage().getLimit(); if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the temporary store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the temp store will not accept any data when used."); } } } }
/** * Check that the store usage limit is not greater than max usable * space and adjust if it is */ protected void checkStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); if (getPersistenceAdapter() != null) { PersistenceAdapter adapter = getPersistenceAdapter(); checkUsageLimit(adapter.getDirectory(), usage.getStoreUsage(), usage.getStoreUsage().getPercentLimit()); long maxJournalFileSize = 0; long storeLimit = usage.getStoreUsage().getLimit(); if (adapter instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) adapter).getJournalMaxFileLength(); } if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the store will not accept any data when used."); } } }
/** * Check that the store usage limit is not greater than max usable * space and adjust if it is */ protected void checkStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); if (getPersistenceAdapter() != null) { PersistenceAdapter adapter = getPersistenceAdapter(); checkUsageLimit(adapter.getDirectory(), usage.getStoreUsage(), usage.getStoreUsage().getPercentLimit()); long maxJournalFileSize = 0; long storeLimit = usage.getStoreUsage().getLimit(); if (adapter instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) adapter).getJournalMaxFileLength(); } if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the store will not accept any data when used."); } } }
/** * Check that the store usage limit is not greater than max usable * space and adjust if it is */ protected void checkStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); if (getPersistenceAdapter() != null) { PersistenceAdapter adapter = getPersistenceAdapter(); checkUsageLimit(adapter.getDirectory(), usage.getStoreUsage(), usage.getStoreUsage().getPercentLimit()); long maxJournalFileSize = 0; long storeLimit = usage.getStoreUsage().getLimit(); if (adapter instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) adapter).getJournalMaxFileLength(); } if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the store will not accept any data when used."); } } }
/** * Check that temporary usage limit is not greater than max usable * space and adjust if it is */ protected void checkTmpStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); File tmpDir = getTmpDataDirectory(); if (tmpDir != null) { checkUsageLimit(tmpDir, usage.getTempUsage(), usage.getTempUsage().getPercentLimit()); if (isPersistent()) { long maxJournalFileSize; PListStore store = usage.getTempUsage().getStore(); if (store != null && store instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) store).getJournalMaxFileLength(); } else { maxJournalFileSize = DEFAULT_MAX_FILE_LENGTH; } long storeLimit = usage.getTempUsage().getLimit(); if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the temporary store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the temp store will not accept any data when used."); } } } }
/** * Check that temporary usage limit is not greater than max usable * space and adjust if it is */ protected void checkTmpStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); File tmpDir = getTmpDataDirectory(); if (tmpDir != null) { checkUsageLimit(tmpDir, usage.getTempUsage(), usage.getTempUsage().getPercentLimit()); if (isPersistent()) { long maxJournalFileSize; PListStore store = usage.getTempUsage().getStore(); if (store != null && store instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) store).getJournalMaxFileLength(); } else { maxJournalFileSize = DEFAULT_MAX_FILE_LENGTH; } long storeLimit = usage.getTempUsage().getLimit(); if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the temporary store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the temp store will not accept any data when used."); } } } }
/** * Check that temporary usage limit is not greater than max usable * space and adjust if it is */ protected void checkTmpStoreUsageLimits() throws Exception { final SystemUsage usage = getSystemUsage(); File tmpDir = getTmpDataDirectory(); if (tmpDir != null) { checkUsageLimit(tmpDir, usage.getTempUsage(), usage.getTempUsage().getPercentLimit()); if (isPersistent()) { long maxJournalFileSize; PListStore store = usage.getTempUsage().getStore(); if (store != null && store instanceof JournaledStore) { maxJournalFileSize = ((JournaledStore) store).getJournalMaxFileLength(); } else { maxJournalFileSize = DEFAULT_MAX_FILE_LENGTH; } long storeLimit = usage.getTempUsage().getLimit(); if (storeLimit > 0 && storeLimit < maxJournalFileSize) { LOG.error("Temporary Store limit is " + storeLimit / (1024 * 1024) + " mb, whilst the max journal file size for the temporary store is: " + maxJournalFileSize / (1024 * 1024) + " mb, " + "the temp store will not accept any data when used."); } } } }