-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge release branch into feature branch
- Loading branch information
Showing
35 changed files
with
935 additions
and
553 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
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,21 @@ | ||
name: Label Checker | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- labeled | ||
- unlabeled | ||
|
||
jobs: | ||
|
||
check_labels: | ||
name: Check labels | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: docker://agilepathway/pull-request-label-checker:latest | ||
with: | ||
one_of: breaking-change,enhancement,bug,documentation,ignore-for-release | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
32 changes: 32 additions & 0 deletions
32
...rc/main/java/edu/harvard/hms/dbmi/avillach/hpds/storage/FileBackedJavaIndexedStorage.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,32 @@ | ||
package edu.harvard.hms.dbmi.avillach.hpds.storage; | ||
|
||
import java.io.*; | ||
import java.util.zip.GZIPInputStream; | ||
import java.util.zip.GZIPOutputStream; | ||
|
||
public class FileBackedJavaIndexedStorage <K, V extends Serializable> extends FileBackedByteIndexedStorage<K, V> { | ||
public FileBackedJavaIndexedStorage(Class<K> keyClass, Class<V> valueClass, File storageFile) throws FileNotFoundException { | ||
super(keyClass, valueClass, storageFile); | ||
} | ||
|
||
protected ByteArrayOutputStream writeObject(V value) throws IOException { | ||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | ||
ObjectOutputStream oos = new ObjectOutputStream(new GZIPOutputStream(out)); | ||
oos.writeObject(value); | ||
oos.flush(); | ||
oos.close(); | ||
return out; | ||
} | ||
|
||
@Override | ||
protected V readObject(byte[] buffer) { | ||
try (ObjectInputStream in = new ObjectInputStream(new GZIPInputStream(new ByteArrayInputStream(buffer)));) { | ||
V readObject = (V) in.readObject(); | ||
return readObject; | ||
} catch (IOException e) { | ||
throw new UncheckedIOException(e); | ||
} catch (ClassNotFoundException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
.../src/main/java/edu/harvard/hms/dbmi/avillach/hpds/storage/FileBackedJsonIndexStorage.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,40 @@ | ||
package edu.harvard.hms.dbmi.avillach.hpds.storage; | ||
|
||
import org.codehaus.jackson.map.ObjectMapper; | ||
import org.codehaus.jackson.type.TypeReference; | ||
|
||
import java.io.*; | ||
import java.util.zip.GZIPInputStream; | ||
import java.util.zip.GZIPOutputStream; | ||
|
||
public abstract class FileBackedJsonIndexStorage <K, V extends Serializable> extends FileBackedByteIndexedStorage<K, V> { | ||
private static final long serialVersionUID = -1086729119489479152L; | ||
|
||
protected transient ObjectMapper objectMapper = new ObjectMapper(); | ||
|
||
public FileBackedJsonIndexStorage(File storageFile) throws FileNotFoundException { | ||
super(null, null, storageFile); | ||
} | ||
|
||
protected ByteArrayOutputStream writeObject(V value) throws IOException { | ||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | ||
objectMapper.writeValue(new GZIPOutputStream(out), value); | ||
return out; | ||
} | ||
|
||
protected V readObject(byte[] buffer) { | ||
try { | ||
return objectMapper.readValue(new GZIPInputStream(new ByteArrayInputStream(buffer)), getTypeReference()); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
// Required to populate the objectMapper on deserialization | ||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { | ||
in.defaultReadObject(); | ||
objectMapper = new ObjectMapper(); | ||
} | ||
|
||
public abstract TypeReference<V> getTypeReference(); | ||
} |
Oops, something went wrong.