Skip to content

Commit

Permalink
Rename metadata files to items, properties, contexts.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwenzel committed Dec 5, 2023
1 parent 3788cb0 commit df60ee0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void execute() throws IOException {

private void performMappingFileCompaction() throws IOException {
Map<String, List<Pair<String, Integer>>> mappingFiles = getMappingFiles(Paths.get(archiveLocation, "metadata"));
if (mappingFiles.get("itemMapping").size() >= mappingFileCompactionTrigger) {
if (mappingFiles.get("items").size() >= mappingFileCompactionTrigger) {
kvinParquet.readLock.lock();
generateCompactedMappingFiles(mappingFiles, new File(compactionFolder, "metadata"));
kvinParquet.readLock.unlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ private void putInternal(Iterable<KvinTuple> tuples) throws IOException {

java.nio.file.Path tempPath = Paths.get(archiveLocation, ".tmp");
Files.createDirectories(tempPath);
Path itemMappingFile = new Path(tempPath.toString(), "metadata/itemMapping__1.parquet");
Path propertyMappingFile = new Path(tempPath.toString(), "metadata/propertyMapping__1.parquet");
Path contextMappingFile = new Path(tempPath.toString(), "metadata/contextMapping__1.parquet");
Path itemMappingFile = new Path(tempPath.toString(), "metadata/items__1.parquet");
Path propertyMappingFile = new Path(tempPath.toString(), "metadata/properties__1.parquet");
Path contextMappingFile = new Path(tempPath.toString(), "metadata/contexts__1.parquet");

ParquetWriter<Object> itemMappingWriter = getParquetMappingWriter(itemMappingFile);
ParquetWriter<Object> propertyMappingWriter = getParquetMappingWriter(propertyMappingFile);
Expand Down Expand Up @@ -394,18 +394,18 @@ private long getId(URI entity, IdType idType) {
String name;
switch (idType) {
case ITEM_ID:
name = "item";
name = "items";
break;
case PROPERTY_ID:
name = "property";
name = "properties";
break;
default:
//case CONTEXT_ID:
name = "context";
name = "contexts";
break;
}
FilterPredicate filter = eq(FilterApi.binaryColumn("value"), Binary.fromString(entity.toString()));
File[] mappingFiles = new File(this.archiveLocation + "metadata/").listFiles((file, s) -> s.startsWith(name + "Mapping"));
File[] mappingFiles = new File(this.archiveLocation + "metadata/").listFiles((file, s) -> s.startsWith(name));
if (mappingFiles == null) {
return 0L;
}
Expand Down Expand Up @@ -491,7 +491,7 @@ public String getProperty(KvinTupleInternal tuple) {
try {
FilterPredicate filter = eq(FilterApi.longColumn("id"), propertyId);
Path metadataFolder = new Path(this.archiveLocation + "metadata/");
File[] mappingFiles = new File(metadataFolder.toString()).listFiles((file, s) -> s.startsWith("propertyMapping"));
File[] mappingFiles = new File(metadataFolder.toString()).listFiles((file, s) -> s.startsWith("properties"));
IdMapping propertyMapping = null;

for (File mappingFile : mappingFiles) {
Expand Down

0 comments on commit df60ee0

Please sign in to comment.