@Test public void testGetFileInfoWithInvalidationDisabled() throws Exception { Path backendFilePath = new Path(TestUtil.getDefaultTestDirectoryPath(conf), BACKEND_FILE_NAME); DataGen.populateFile(backendFilePath.toString()); int expectedFileSize = DataGen.generateContent(1).length(); CacheConfig.setFileStalenessCheck(conf, false); FileInfo info = bookKeeper.getFileInfo(backendFilePath.toString()); assertTrue(info.getFileSize() == expectedFileSize, "FileSize was not equal to the expected value." + " Got FileSize: " + info.getFileSize() + " Expected Value : " + expectedFileSize); DataGen.populateFile(backendFilePath.toString(), 2); info = bookKeeper.getFileInfo(backendFilePath.toString()); assertTrue(info.getFileSize() == expectedFileSize, "FileSize was not equal to the expected value." + " Got FileSize: " + info.getFileSize() + " Expected Value : " + expectedFileSize); }
@Override public FileInfo getFileInfo(String remotePath) throws TException { try { return fileInfoCache.get(remotePath); } catch (ExecutionException e) { log.error(String.format("Could not fetch FileInfo from Cache for %s", remotePath), e); throw new TException(e); } }
BookKeeper implements BookKeeperService.Iface { @Override public FileInfo getFileInfo(String remotePath) throws TException { try { return fileInfoCache.get(remotePath); } catch (ExecutionException e) { log.error(String.format("Could not fetch FileInfo from Cache for %s", remotePath), e); throw new TException(e); } } }
BookKeeper implements BookKeeperService.Iface { @Override public FileInfo getFileInfo(String remotePath) throws TException { try { return fileInfoCache.get(remotePath); } catch (ExecutionException e) { log.error(String.format("Could not fetch FileInfo from Cache for %s", remotePath), e); throw new TException(e); } } BookKeeper(Configuration conf, BookKeeperMetrics bookKeeperMetrics); @VisibleForTesting  BookKeeper(Configuration conf, BookKeeperMetrics bookKeeperMetrics, Ticker ticker); }
BookKeeper implements BookKeeperService.Iface { @Override public FileInfo getFileInfo(String remotePath) throws TException { try { return fileInfoCache.get(remotePath); } catch (ExecutionException e) { log.error(String.format("Could not fetch FileInfo from Cache for %s", remotePath), e); throw new TException(e); } } BookKeeper(Configuration conf, BookKeeperMetrics bookKeeperMetrics); @VisibleForTesting  BookKeeper(Configuration conf, BookKeeperMetrics bookKeeperMetrics, Ticker ticker); @Override boolean isBookKeeperAlive(); @Override CacheStatusResponse getCacheStatus(CacheStatusRequest request); boolean isInitialized(); @VisibleForTesting void initializeClusterManager(int clusterType); @VisibleForTesting ClusterManager getClusterManagerInstance(ClusterType clusterType, Configuration config); @Override void setAllCached(String remotePath, long fileLength, long lastModified, long startBlock, long endBlock, int generationNumber); @VisibleForTesting long getTotalCacheWeight(); @Override Map<String, Double> getCacheMetrics(); @Override Map<String, Long> getReadRequestChainStats(); @Override ReadResponse readData(String remotePath, long offset, int length, long fileSize, long lastModified, int clusterType); @Override FileInfo getFileInfo(String remotePath); @VisibleForTesting FileMetadata getFileMetadata(String key); @Override void invalidateFileMetadata(String key); }
BookKeeper implements BookKeeperService.Iface { @Override public FileInfo getFileInfo(String remotePath) throws TException { try { return fileInfoCache.get(remotePath); } catch (ExecutionException e) { log.error(String.format("Could not fetch FileInfo from Cache for %s", remotePath), e); throw new TException(e); } } BookKeeper(Configuration conf, BookKeeperMetrics bookKeeperMetrics); @VisibleForTesting  BookKeeper(Configuration conf, BookKeeperMetrics bookKeeperMetrics, Ticker ticker); @Override boolean isBookKeeperAlive(); @Override CacheStatusResponse getCacheStatus(CacheStatusRequest request); boolean isInitialized(); @VisibleForTesting void initializeClusterManager(int clusterType); @VisibleForTesting ClusterManager getClusterManagerInstance(ClusterType clusterType, Configuration config); @Override void setAllCached(String remotePath, long fileLength, long lastModified, long startBlock, long endBlock, int generationNumber); @VisibleForTesting long getTotalCacheWeight(); @Override Map<String, Double> getCacheMetrics(); @Override Map<String, Long> getReadRequestChainStats(); @Override ReadResponse readData(String remotePath, long offset, int length, long fileSize, long lastModified, int clusterType); @Override FileInfo getFileInfo(String remotePath); @VisibleForTesting FileMetadata getFileMetadata(String key); @Override void invalidateFileMetadata(String key);  }