File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
java/plasma/src/main/java/org/apache/arrow/plasma Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 2323import java .util .List ;
2424
2525import org .apache .arrow .plasma .exceptions .DuplicateObjectException ;
26+ import org .apache .arrow .plasma .exceptions .PlasmaClientException ;
2627import org .apache .arrow .plasma .exceptions .PlasmaOutOfMemoryException ;
2728
2829/**
@@ -35,13 +36,27 @@ public class PlasmaClient implements ObjectStoreLink {
3536
3637 private final long conn ;
3738
39+ private boolean hasConnectException = false ;
40+
3841 protected void finalize () {
39- PlasmaClientJNI .disconnect (this .conn );
42+ if (!hasConnectException ) {
43+ PlasmaClientJNI .disconnect (this .conn );
44+ }
4045 }
4146
42- // use plasma client to initialize the underlying jni system as well via config and config-overwrites
47+ /**
48+ * use plasma client to initialize the underlying jni system as well via config and config-overwrites.
49+ * @param storeSocketName Socket path of Plasma server
50+ * @param managerSocketName managerSocketName
51+ * @param releaseDelay releaseDelay
52+ */
4353 public PlasmaClient (String storeSocketName , String managerSocketName , int releaseDelay ) {
44- this .conn = PlasmaClientJNI .connect (storeSocketName , managerSocketName , releaseDelay );
54+ try {
55+ this .conn = PlasmaClientJNI .connect (storeSocketName , managerSocketName , releaseDelay );
56+ } catch (PlasmaClientException e ) {
57+ hasConnectException = true ;
58+ throw e ;
59+ }
4560 }
4661
4762 // interface methods --------------------
You can’t perform that action at this time.
0 commit comments