-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Atanas Atanasov <[email protected]>
- Loading branch information
Showing
21 changed files
with
291 additions
and
53 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
32 changes: 32 additions & 0 deletions
32
.../src/main/java/com/hedera/block/server/persistence/storage/path/AbstractPathResolver.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 @@ | ||
/* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.block.server.persistence.storage.path; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import java.nio.file.Path; | ||
import java.util.Objects; | ||
|
||
/** | ||
* TODO: add documentation | ||
*/ | ||
abstract class AbstractPathResolver implements PathResolver { | ||
private final Path root; | ||
|
||
AbstractPathResolver(@NonNull final Path root) { | ||
this.root = Objects.requireNonNull(root); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...rc/main/java/com/hedera/block/server/persistence/storage/path/BlockAsDirPathResolver.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,34 @@ | ||
/* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.block.server.persistence.storage.path; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import java.nio.file.Path; | ||
|
||
/** | ||
* TODO: add documentation | ||
*/ | ||
public final class BlockAsDirPathResolver extends AbstractPathResolver { | ||
public BlockAsDirPathResolver(@NonNull final Path root) { | ||
super(root); | ||
} | ||
|
||
@Override | ||
public Path resolvePathToBlock(final long blockNumber) { | ||
throw new UnsupportedOperationException("Not implemented yet"); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...c/main/java/com/hedera/block/server/persistence/storage/path/BlockAsFilePathResolver.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,34 @@ | ||
/* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.block.server.persistence.storage.path; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import java.nio.file.Path; | ||
|
||
/** | ||
* TODO: add documentation | ||
*/ | ||
public final class BlockAsFilePathResolver extends AbstractPathResolver { | ||
public BlockAsFilePathResolver(@NonNull final Path root) { | ||
super(root); | ||
} | ||
|
||
@Override | ||
public Path resolvePathToBlock(final long blockNumber) { | ||
throw new UnsupportedOperationException("Not implemented yet"); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
server/src/main/java/com/hedera/block/server/persistence/storage/path/NoOpPathResolver.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,35 @@ | ||
/* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.block.server.persistence.storage.path; | ||
|
||
import static java.lang.System.Logger.Level.INFO; | ||
|
||
import java.nio.file.Path; | ||
|
||
/** | ||
* TODO: add documentation | ||
*/ | ||
public final class NoOpPathResolver implements PathResolver { | ||
public NoOpPathResolver() { | ||
System.getLogger(getClass().getName()).log(INFO, "Using " + getClass().getSimpleName()); | ||
} | ||
|
||
@Override | ||
public Path resolvePathToBlock(final long blockNumber) { | ||
return null; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
server/src/main/java/com/hedera/block/server/persistence/storage/path/PathResolver.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,26 @@ | ||
/* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.block.server.persistence.storage.path; | ||
|
||
import java.nio.file.Path; | ||
|
||
/** | ||
* TODO: add documentation | ||
*/ | ||
public interface PathResolver { | ||
Path resolvePathToBlock(final long blockNumber); | ||
} |
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
Oops, something went wrong.