public static String getResourcePath(String tableName, String uuid) { return getResourceDir(tableName) + "/" + uuid + ".snapshot"; }
public String getResourceDir() { return getResourceDir(tableName); }
public List<ExtTableSnapshotInfo> getSnapshots(String tableName) throws IOException { String tableSnapshotsPath = ExtTableSnapshotInfo.getResourceDir(tableName); ResourceStore store = TableMetadataManager.getInstance(this.config).getStore(); return store.getAllResources(tableSnapshotsPath, SNAPSHOT_SERIALIZER); }
private ExtTableSnapshotInfo checkDupByInfo(ExtTableSnapshotInfo snapshot) throws IOException { ResourceStore store = TableMetadataManager.getInstance(this.config).getStore(); String resourceDir = snapshot.getResourceDir(); NavigableSet<String> existings = store.listResources(resourceDir); if (existings == null) return null; TableSignature sig = snapshot.getSignature(); for (String existing : existings) { ExtTableSnapshotInfo existingSnapshot = load(existing); // direct load from store if (existingSnapshot != null && sig.equals(existingSnapshot.getSignature())) return existingSnapshot; } return null; }
public String getResourceDir() { return getResourceDir(tableName); }
public static String getResourcePath(String tableName, String uuid) { return getResourceDir(tableName) + "/" + uuid + ".snapshot"; }
public List<ExtTableSnapshotInfo> getSnapshots(String tableName) throws IOException { String tableSnapshotsPath = ExtTableSnapshotInfo.getResourceDir(tableName); ResourceStore store = TableMetadataManager.getInstance(this.config).getStore(); return store.getAllResources(tableSnapshotsPath, SNAPSHOT_SERIALIZER); }
private ExtTableSnapshotInfo checkDupByInfo(ExtTableSnapshotInfo snapshot) throws IOException { ResourceStore store = TableMetadataManager.getInstance(this.config).getStore(); String resourceDir = snapshot.getResourceDir(); NavigableSet<String> existings = store.listResources(resourceDir); if (existings == null) return null; TableSignature sig = snapshot.getSignature(); for (String existing : existings) { ExtTableSnapshotInfo existingSnapshot = load(existing); // direct load from store if (existingSnapshot != null && sig.equals(existingSnapshot.getSignature())) return existingSnapshot; } return null; }