From d1bc28d7c0746ebaf1ad958468b0bf3e36ef1e88 Mon Sep 17 00:00:00 2001 From: Patrick Dowler Date: Mon, 8 Apr 2024 13:01:16 -0700 Subject: [PATCH 1/2] cadc-storage-adapter: update to cadc-vos-2.0 --- cadc-storage-adapter-ad/build.gradle | 8 ++++---- .../inventory/storage/ad/AdStorageAdapter.java | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cadc-storage-adapter-ad/build.gradle b/cadc-storage-adapter-ad/build.gradle index bb6e236f..0335339f 100644 --- a/cadc-storage-adapter-ad/build.gradle +++ b/cadc-storage-adapter-ad/build.gradle @@ -14,7 +14,7 @@ sourceCompatibility = 1.8 group = 'org.opencadc' -version = '0.6.5' +version = '0.7.0' description = 'OpenCADC Storage Inventory AdStorageAdapter implementation' def git_url = 'https://github.com/opencadc/storage-inventory' @@ -24,10 +24,10 @@ dependencies { compile 'org.opencadc:cadc-cdp:[1.3,2.0)' compile 'org.opencadc:cadc-dali:[1.2.1,)' compile 'org.opencadc:cadc-tap:[1.1.12,)' - compile 'org.opencadc:cadc-inventory:[0.9.3,)' - compile 'org.opencadc:cadc-storage-adapter:[0.11.2,)' + compile 'org.opencadc:cadc-inventory:[1.0,)' + compile 'org.opencadc:cadc-storage-adapter:[1.0,)' compile 'org.opencadc:cadc-registry:[1.0,)' - compile 'org.opencadc:cadc-vos:[1.2,2.0)' + compile 'org.opencadc:cadc-vos:[2.0,3.0)' testCompile 'junit:junit:[4.0,)' } diff --git a/cadc-storage-adapter-ad/src/main/java/org/opencadc/inventory/storage/ad/AdStorageAdapter.java b/cadc-storage-adapter-ad/src/main/java/org/opencadc/inventory/storage/ad/AdStorageAdapter.java index 5966fd5e..288740ad 100644 --- a/cadc-storage-adapter-ad/src/main/java/org/opencadc/inventory/storage/ad/AdStorageAdapter.java +++ b/cadc-storage-adapter-ad/src/main/java/org/opencadc/inventory/storage/ad/AdStorageAdapter.java @@ -93,13 +93,6 @@ import ca.nrc.cadc.reg.Standards; import ca.nrc.cadc.reg.client.RegistryClient; import ca.nrc.cadc.util.StringUtil; -import ca.nrc.cadc.vos.Direction; -import ca.nrc.cadc.vos.Protocol; -import ca.nrc.cadc.vos.Transfer; -import ca.nrc.cadc.vos.TransferParsingException; -import ca.nrc.cadc.vos.TransferReader; -import ca.nrc.cadc.vos.TransferWriter; -import ca.nrc.cadc.vos.VOS; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -111,7 +104,6 @@ import java.security.AccessControlException; import java.security.cert.CertificateExpiredException; import java.security.cert.CertificateNotYetValidException; -import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -128,6 +120,13 @@ import org.opencadc.inventory.storage.StorageEngageException; import org.opencadc.inventory.storage.StorageMetadata; import org.opencadc.tap.TapClient; +import org.opencadc.vospace.VOS; +import org.opencadc.vospace.transfer.Direction; +import org.opencadc.vospace.transfer.Protocol; +import org.opencadc.vospace.transfer.Transfer; +import org.opencadc.vospace.transfer.TransferParsingException; +import org.opencadc.vospace.transfer.TransferReader; +import org.opencadc.vospace.transfer.TransferWriter; /** * The interface to storage implementations. From 72b810a4081a6761b8307dda19fcff3e6347c88a Mon Sep 17 00:00:00 2001 From: Patrick Dowler Date: Mon, 8 Apr 2024 13:01:37 -0700 Subject: [PATCH 2/2] minoc: error handling during init --- minoc/VERSION | 2 +- minoc/build.gradle | 2 +- .../main/java/org/opencadc/minoc/MinocConfig.java | 5 ----- .../java/org/opencadc/minoc/MinocInitAction.java | 12 ++++++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/minoc/VERSION b/minoc/VERSION index 3d4fab56..7b280609 100644 --- a/minoc/VERSION +++ b/minoc/VERSION @@ -4,6 +4,6 @@ # tags with and without build number so operators use the versioned # tag but we always keep a timestamped tag in case a semantic tag gets # replaced accidentally -VER=1.0.0 +VER=1.0.1 TAGS="${VER} ${VER}-$(date --utc +"%Y%m%dT%H%M%S")" unset VER diff --git a/minoc/build.gradle b/minoc/build.gradle index 2b677564..7a0d8f10 100644 --- a/minoc/build.gradle +++ b/minoc/build.gradle @@ -52,7 +52,7 @@ dependencies { runtime 'org.opencadc:cadc-access-control-identity:[1.2.1,2.0)' runtime 'org.opencadc:cadc-storage-adapter-fs:[0.9.3,)' - runtime 'org.opencadc:cadc-storage-adapter-ad:[0.6.2,)' + runtime 'org.opencadc:cadc-storage-adapter-ad:[0.7.0,)' runtime 'org.opencadc:cadc-storage-adapter-swift:[0.8.7,)' } diff --git a/minoc/src/main/java/org/opencadc/minoc/MinocConfig.java b/minoc/src/main/java/org/opencadc/minoc/MinocConfig.java index 437804b4..22be1444 100644 --- a/minoc/src/main/java/org/opencadc/minoc/MinocConfig.java +++ b/minoc/src/main/java/org/opencadc/minoc/MinocConfig.java @@ -414,9 +414,6 @@ public List getRecoverableNamespaces() { public StorageAdapter getStorageAdapter() { String cname = configProperties.getFirstPropertyValue(MinocConfig.SA_KEY); StorageAdapter storageAdapter = InventoryUtil.loadPlugin(cname); - for (Namespace ns : recoverableNamespaces) { - log.info("initStorageAdapter: recoverableNamespace = " + ns.getNamespace()); - } storageAdapter.setRecoverableNamespaces(recoverableNamespaces); return storageAdapter; } @@ -430,8 +427,6 @@ public Map getDaoConfig() { ret.put("jndiDataSourceName", JNDI_DATASOURCE); ret.put("invSchema", configProperties.getFirstPropertyValue(SCHEMA_KEY)); ret.put("genSchema", configProperties.getFirstPropertyValue(SCHEMA_KEY)); - //config.put("vosSchema", null); - //config.put("database", null); return ret; } catch (ClassNotFoundException ex) { throw new IllegalStateException("invalid config: failed to load SQLGenerator: " + cname); diff --git a/minoc/src/main/java/org/opencadc/minoc/MinocInitAction.java b/minoc/src/main/java/org/opencadc/minoc/MinocInitAction.java index b8bdd677..5720289d 100644 --- a/minoc/src/main/java/org/opencadc/minoc/MinocInitAction.java +++ b/minoc/src/main/java/org/opencadc/minoc/MinocInitAction.java @@ -110,10 +110,14 @@ public MinocInitAction() { @Override public void doInit() { - initConfig(); - initDatabase(); - initStorageSite(); - initStorageAdapter(); + try { + initConfig(); + initDatabase(); + initStorageSite(); + initStorageAdapter(); + } catch (Throwable ex) { + log.error("init fail", ex); + } } @Override