-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
242 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# gzip-reactive | ||
Reactive gzip encoder/decoder | ||
# aerospike storage backend | ||
Aerospike storage backend for Janusgraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
...spike-storage-backend/src/main/java/com/playtika/janusgraph/aerospike/AerospikeLocks.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
aerospike-storage-backend/src/main/java/com/playtika/janusgraph/aerospike/StoreLocks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.playtika.janusgraph.aerospike; | ||
|
||
import org.janusgraph.diskstorage.StaticBuffer; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static java.util.Collections.singletonList; | ||
import static java.util.Collections.unmodifiableMap; | ||
|
||
public class StoreLocks { | ||
|
||
public final String storeName; | ||
public final Map<StaticBuffer, List<AerospikeLock>> locksMap; | ||
|
||
public StoreLocks(String storeName, List<AerospikeLock> locks) { | ||
this.storeName = storeName; | ||
Map<StaticBuffer, List<AerospikeLock>> locksMap = new HashMap<>(locks.size()); | ||
|
||
for(AerospikeLock lock : locks){ | ||
locksMap.compute(lock.key, (key, locksForKey) -> { | ||
if(locksForKey == null || locksForKey.isEmpty()){ | ||
return singletonList(lock); | ||
} else if(locksForKey.size() == 1){ | ||
List<AerospikeLock> locksForKeyNew = new ArrayList<>(locksForKey); | ||
locksForKeyNew.add(lock); | ||
return locksForKeyNew; | ||
} else { | ||
locksForKey.add(lock); | ||
return locksForKey; | ||
} | ||
}); | ||
} | ||
|
||
this.locksMap = unmodifiableMap(locksMap); | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
...spike-storage-backend/src/main/java/com/playtika/janusgraph/aerospike/util/AsyncUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
package com.playtika.janusgraph.aerospike.util; | ||
|
||
import org.janusgraph.diskstorage.PermanentBackendException; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.concurrent.ExecutionException; | ||
|
||
public class AsyncUtil { | ||
|
||
public static void allOf(List<CompletableFuture<?>> futures){ | ||
public static void allOf(List<CompletableFuture<?>> futures) throws PermanentBackendException { | ||
try { | ||
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).get(); | ||
} catch (InterruptedException | ExecutionException e) { | ||
throw new RuntimeException(); | ||
throw new PermanentBackendException(e); | ||
} | ||
} | ||
} |
Oops, something went wrong.