throw new ConfigurationException("CasStorage as a target is currently only compatible with CasStorage as a source"); Assert.hasText(config.getConnectionString()); FPPool.RegisterApplication(config.getApplicationName(), config.getApplicationVersion()); FPPool.setGlobalOption(FPLibraryConstants.FP_OPTION_MAXCONNECTIONS, 999); // maximum allowed pool = new CasPool(config.getConnectionString()); pool.setOption(FPLibraryConstants.FP_OPTION_BUFFERSIZE, CAS_SDK_BUFFER_SIZE); throw new ConfigurationException("DELETE is not allowed for this pool connection"); if (getOptions().isDeleteSource() && config.isPrivilegedDelete() && pool.getCapability(FPLibraryConstants.FP_PRIVILEGEDDELETE, FPLibraryConstants.FP_ALLOWED).equals("False")) throw new ConfigurationException("PRIVILEGED-DELETE is not allowed for this pool connection"); if (config.getQueryStartTime() != null) { queryStartTime = Iso8601Util.parse(config.getQueryStartTime()); if (queryStartTime == null) throw new ConfigurationException("could not parse query-start-time"); if (config.getQueryEndTime() != null) { queryEndTime = Iso8601Util.parse(config.getQueryEndTime()); if (queryEndTime == null) throw new ConfigurationException("could not parse query-end-time"); if (queryStartTime != null && queryStartTime.after(queryEndTime)) if (config.isLargeBlobCountEnabled()) { blobReadExecutor = new EnhancedThreadPoolExecutor(options.getThreadCount(), new LinkedBlockingDeque<Runnable>(100), getRole() + "-blob-reader-");
@Override public void delete(String identifier) { try { long OPTS = config.isPrivilegedDelete() ? FPLibraryConstants.FP_OPTION_DELETE_PRIVILEGED : FPLibraryConstants.FP_OPTION_DEFAULT_OPTIONS; FPClip.AuditedDelete(pool, identifier, config.getDeleteReason(), OPTS); } catch (FPLibraryException e) { throw new RuntimeException(summarizeError(e), e); } }
@XmlTransient @UriGenerator public String getUri() { return URI_PREFIX + bin(connectionString); }
Assert.assertEquals("source conString mismatch", "hpp://" + conString1, castSource.getConnectionString()); Assert.assertEquals("source appName mismatch", appName, castSource.getApplicationName()); Assert.assertEquals("source appVersion mismatch", appVersion, castSource.getApplicationVersion()); Assert.assertEquals("source deleteReason mismatch", deleteReason, castSource.getDeleteReason()); Assert.assertEquals("target conString mismatch", "hpp://" + conString2, castTarget.getConnectionString());
private EcsSync createEcsSync(String connectString1, String connectString2, int threadCount, boolean enableTimings) throws Exception { SyncConfig syncConfig = new SyncConfig(); syncConfig.setSource(new CasConfig().withConnectionString(connectString1)); syncConfig.setTarget(new CasConfig().withConnectionString(connectString2)); syncConfig.setOptions(new SyncOptions().withThreadCount(threadCount).withRetryAttempts(1).withTimingsEnabled(enableTimings)); EcsSync sync = new EcsSync(); sync.setSyncConfig(syncConfig); return sync; }
private synchronized boolean loadNextTag() { if (allClipsLoaded) return false; // we already have all the tags // actually pull next tag from clip CasTag tag = null; try { tag = clip.FetchNext(); if (tag == null) { // the tag before this was the last tag allClipsLoaded = true; return false; } EnhancedTag enhancedTag = new EnhancedTag(tag, tagIndex++, getSource().getOptions().getBufferSize(), progressListener, blobReadExecutor); enhancedTag.setDrainOnError(casConfig.isDrainBlobsOnError()); tags.add(enhancedTag); return true; } catch (Throwable t) { if (tag != null) tag.close(); if (t instanceof RuntimeException) throw (RuntimeException) t; else if (t instanceof FPLibraryException) throw new RuntimeException(CasStorage.summarizeError((FPLibraryException) t), t); else throw new RuntimeException(t); } }
if (!config.isLargeBlobCountEnabled()) { for (EnhancedTag tag : clipObject.getTags())
syncConfig.setOptions(new SyncOptions().withThreadCount(CAS_THREADS).withSourceListFile(clipFile.getAbsolutePath()) .withDeleteSource(true)); syncConfig.setSource(new CasConfig().withConnectionString(connectString1)); syncConfig.setTarget(new com.emc.ecs.sync.config.storage.TestConfig());
.withSource(new CasConfig().withConnectionString(casConnection)) .withTarget(new com.emc.ecs.sync.config.storage.TestConfig().withDiscardData(false)) .withFilters(Collections.singletonList(filterConfig))
.withSource(new CasConfig().withConnectionString(casConnection)) .withTarget(new com.emc.ecs.sync.config.storage.TestConfig().withDiscardData(false)) .withFilters(Collections.singletonList(filterConfig))
Files.write(listFile.toPath(), cifsCsvData.getBytes(Charsets.UTF_8)); SyncConfig syncConfig = new SyncConfig().withSource(new CasConfig().withConnectionString(connectString)) .withTarget(new com.emc.ecs.sync.config.storage.TestConfig().withDiscardData(false)) .withFilters(Collections.singletonList(new CuaExtractorConfig()));
Files.write(listFile.toPath(), dxCsvData.getBytes(Charsets.UTF_8)); SyncConfig syncConfig = new SyncConfig().withSource(new CasConfig().withConnectionString(connectString)) .withTarget(new com.emc.ecs.sync.config.storage.TestConfig().withDiscardData(false)) .withFilters(Collections.singletonList(new DxExtractorConfig()));