@Test public void deleteNotExist() throws Exception { assertFalse(mCacheManager.delete(PAGE_ID1)); }
@Override public boolean delete(PageId pageId) { LOG.debug("delete({}) enters", pageId); if (mState.get() != READ_WRITE) { Metrics.DELETE_NOT_READY_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } ReadWriteLock pageLock = getPageLock(pageId); try (LockResource r = new LockResource(pageLock.writeLock())) { try (LockResource r1 = new LockResource(mMetaLock.writeLock())) { try { mMetaStore.removePage(pageId); } catch (PageNotFoundException e) { LOG.error("Failed to delete page {}: {}", pageId, e); Metrics.DELETE_NON_EXISTING_PAGE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } } boolean ok = deletePage(pageId); LOG.debug("delete({}) exits, success: {}", pageId, ok); if (!ok) { Metrics.DELETE_STORE_DELETE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); } return ok; } }
LocalCacheManager implements CacheManager { @Override public boolean delete(PageId pageId) { LOG.debug("delete({}) enters", pageId); if (mState.get() != READ_WRITE) { Metrics.DELETE_NOT_READY_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } ReadWriteLock pageLock = getPageLock(pageId); try (LockResource r = new LockResource(pageLock.writeLock())) { try (LockResource r1 = new LockResource(mMetaLock.writeLock())) { try { mMetaStore.removePage(pageId); } catch (PageNotFoundException e) { LOG.error("Failed to delete page {}: {}", pageId, e); Metrics.DELETE_NON_EXISTING_PAGE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } } boolean ok = deletePage(pageId); LOG.debug("delete({}) exits, success: {}", pageId, ok); if (!ok) { Metrics.DELETE_STORE_DELETE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); } return ok; } } }
LocalCacheManager implements CacheManager { @Override public boolean delete(PageId pageId) { LOG.debug("delete({}) enters", pageId); if (mState.get() != READ_WRITE) { Metrics.DELETE_NOT_READY_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } ReadWriteLock pageLock = getPageLock(pageId); try (LockResource r = new LockResource(pageLock.writeLock())) { try (LockResource r1 = new LockResource(mMetaLock.writeLock())) { try { mMetaStore.removePage(pageId); } catch (PageNotFoundException e) { LOG.error("Failed to delete page {}: {}", pageId, e); Metrics.DELETE_NON_EXISTING_PAGE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } } boolean ok = deletePage(pageId); LOG.debug("delete({}) exits, success: {}", pageId, ok); if (!ok) { Metrics.DELETE_STORE_DELETE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); } return ok; } } private  LocalCacheManager(AlluxioConfiguration conf, MetaStore metaStore, PageStore pageStore); }
LocalCacheManager implements CacheManager { @Override public boolean delete(PageId pageId) { LOG.debug("delete({}) enters", pageId); if (mState.get() != READ_WRITE) { Metrics.DELETE_NOT_READY_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } ReadWriteLock pageLock = getPageLock(pageId); try (LockResource r = new LockResource(pageLock.writeLock())) { try (LockResource r1 = new LockResource(mMetaLock.writeLock())) { try { mMetaStore.removePage(pageId); } catch (PageNotFoundException e) { LOG.error("Failed to delete page {}: {}", pageId, e); Metrics.DELETE_NON_EXISTING_PAGE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } } boolean ok = deletePage(pageId); LOG.debug("delete({}) exits, success: {}", pageId, ok); if (!ok) { Metrics.DELETE_STORE_DELETE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); } return ok; } } private  LocalCacheManager(AlluxioConfiguration conf, MetaStore metaStore, PageStore pageStore); static LocalCacheManager create(AlluxioConfiguration conf); @Override boolean put(PageId pageId, byte[] page); @Override int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer,
      int offsetInBuffer); @Override boolean delete(PageId pageId); @Override State state(); @Override void close(); }
LocalCacheManager implements CacheManager { @Override public boolean delete(PageId pageId) { LOG.debug("delete({}) enters", pageId); if (mState.get() != READ_WRITE) { Metrics.DELETE_NOT_READY_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } ReadWriteLock pageLock = getPageLock(pageId); try (LockResource r = new LockResource(pageLock.writeLock())) { try (LockResource r1 = new LockResource(mMetaLock.writeLock())) { try { mMetaStore.removePage(pageId); } catch (PageNotFoundException e) { LOG.error("Failed to delete page {}: {}", pageId, e); Metrics.DELETE_NON_EXISTING_PAGE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); return false; } } boolean ok = deletePage(pageId); LOG.debug("delete({}) exits, success: {}", pageId, ok); if (!ok) { Metrics.DELETE_STORE_DELETE_ERRORS.inc(); Metrics.DELETE_ERRORS.inc(); } return ok; } } private  LocalCacheManager(AlluxioConfiguration conf, MetaStore metaStore, PageStore pageStore); static LocalCacheManager create(AlluxioConfiguration conf); @Override boolean put(PageId pageId, byte[] page); @Override int get(PageId pageId, int pageOffset, int bytesToRead, byte[] buffer,
      int offsetInBuffer); @Override boolean delete(PageId pageId); @Override State state(); @Override void close();  }