Skip to content

Commit 46c8e2a

Browse files
committed
Updates
1 parent aed1b43 commit 46c8e2a

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ To use this SDK, add the following dependency to your project:
2323
Documentation is avalailable in [Awesome Astra](https://awesome-astra.github.io/docs/pages/tools/integration/apache-beam-google-dataflow/) with sample codes
2424

2525

26-
- Read Data From Astra
26+
- **Read Data From Astra**
2727

2828
```java
29+
// LanguageCode is a sample Pojo
2930

30-
// LanguageCode is a sample Pojo
31+
// LanguageCodeDaoMapperFactoryFn implements
32+
// SerializableFunction<CqlSession, AstraDbMapper<LanguageCode>>
3133

32-
// LanguageCodeDaoMapperFactoryFn implements
33-
// SerializableFunction<CqlSession, AstraDbMapper<LanguageCode>>
34+
// Get binary from File path
35+
byte[] scbZip = AstraSecureConnectBundleUtils
36+
.loadFromFilePath(options.getAstraSecureConnectBundle());
3437

3538
AstraDbIO.Read<LanguageCode> read = AstraDbIO.<LanguageCode>read()
3639
.withToken(options.getAstraToken())

release.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#release configuration
2+
#Mon Jun 26 14:51:31 CEST 2023
3+
projectVersionPolicyId=default
4+
scm.tagNameFormat=@{project.version}
5+
remoteTagging=true
6+
scm.commentPrefix=[maven-release-plugin]
7+
pushChanges=true
8+
completedPhase=check-poms
9+
scm.url=scm\:git\:[email protected]\:clun/beam-sdks-java-io-astra.git
10+
exec.snapshotReleasePluginAllowed=false
11+
preparationGoals=clean verify

src/main/java/org/apache/beam/sdk/io/astra/db/CqlSessionHolder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,18 @@ private static synchronized void init() {
169169
} catch (NoSuchAlgorithmException e) {
170170
throw new IllegalStateException("SHA-1 is not supported");
171171
}
172-
// Add a Shutdown Hook to close all sessions.
173-
Runtime.getRuntime().addShutdownHook(new Thread(() -> { cleanup(); }));
174172
}
175173
}
176174

177175
/**
178176
* Close all sessions.
179177
*/
180178
public static void cleanup() {
181-
cacheSessions.values().stream()
182-
.filter(s->!s.isClosed())
183-
.forEach(CqlSession::close);
179+
if (cacheSessions != null) {
180+
cacheSessions.values().stream()
181+
.filter(s -> !s.isClosed())
182+
.forEach(CqlSession::close);
183+
}
184184
}
185185

186186
}

0 commit comments

Comments
 (0)