/** * Read and return the contents of the offset file. * * @param storagePartitionDir the base directory of the store * @param offsetFileName name of the offset file * @return the content of the offset file if it exists for the store, null otherwise. */ public static String readOffsetFile(File storagePartitionDir, String offsetFileName) { String offset = null; File offsetFileRef = new File(storagePartitionDir, offsetFileName); String storePath = storagePartitionDir.getPath(); if (offsetFileRef.exists()) { LOG.info("Found offset file in storage partition directory: {}", storePath); try { offset = FileUtil.readWithChecksum(offsetFileRef); } catch (Exception e) { LOG.warn("Failed to read offset file in storage partition directory: {}", storePath, e); } } else { LOG.info("No offset file found in storage partition directory: {}", storePath); } return offset; }
/** * Read and return the contents of the offset file. * * @param storagePartitionDir the base directory of the store * @param offsetFileName name of the offset file * @return the content of the offset file if it exists for the store, null otherwise. */ public static String readOffsetFile(File storagePartitionDir, String offsetFileName) { String offset = null; File offsetFileRef = new File(storagePartitionDir, offsetFileName); String storePath = storagePartitionDir.getPath(); if (offsetFileRef.exists()) { LOG.info("Found offset file in storage partition directory: {}", storePath); try { offset = FileUtil.readWithChecksum(offsetFileRef); } catch (Exception e) { LOG.warn("Failed to read offset file in storage partition directory: {}", storePath, e); } } else { LOG.info("No offset file found in storage partition directory: {}", storePath); } return offset; } }
/** * Read and return the contents of the offset file. * * @param storagePartitionDir the base directory of the store * @param offsetFileName name of the offset file * @return the content of the offset file if it exists for the store, null otherwise. */ public static String readOffsetFile(File storagePartitionDir, String offsetFileName) { String offset = null; File offsetFileRef = new File(storagePartitionDir, offsetFileName); String storePath = storagePartitionDir.getPath(); if (offsetFileRef.exists()) { LOG.info("Found offset file in storage partition directory: {}", storePath); try { offset = FileUtil.readWithChecksum(offsetFileRef); } catch (Exception e) { LOG.warn("Failed to read offset file in storage partition directory: {}", storePath, e); } } else { LOG.info("No offset file found in storage partition directory: {}", storePath); } return offset; } }
/** * Read and return the contents of the offset file. * * @param storagePartitionDir the base directory of the store * @param offsetFileName name of the offset file * @return the content of the offset file if it exists for the store, null otherwise. */ public static String readOffsetFile(File storagePartitionDir, String offsetFileName) { String offset = null; File offsetFileRef = new File(storagePartitionDir, offsetFileName); String storePath = storagePartitionDir.getPath(); if (offsetFileRef.exists()) { LOG.info("Found offset file in storage partition directory: {}", storePath); try { offset = FileUtil.readWithChecksum(offsetFileRef); } catch (Exception e) { LOG.warn("Failed to read offset file in storage partition directory: {}", storePath, e); } } else { LOG.info("No offset file found in storage partition directory: {}", storePath); } return offset; } }
/** * Read and return the contents of the offset file. * * @param storagePartitionDir the base directory of the store * @param offsetFileName name of the offset file * @return the content of the offset file if it exists for the store, null otherwise. */ public static String readOffsetFile(File storagePartitionDir, String offsetFileName) { String offset = null; File offsetFileRef = new File(storagePartitionDir, offsetFileName); String storePath = storagePartitionDir.getPath(); if (offsetFileRef.exists()) { LOG.info("Found offset file in storage partition directory: {}", storePath); try { offset = FileUtil.readWithChecksum(offsetFileRef); } catch (Exception e) { LOG.warn("Failed to read offset file in storage partition directory: {}", storePath, e); } } else { LOG.info("No offset file found in storage partition directory: {}", storePath); } return offset; } }