Package org.codice.ddf.commands.catalog
Class DuplicateCommands
java.lang.Object
org.codice.ddf.commands.catalog.CommandSupport
org.codice.ddf.commands.catalog.SubjectCommands
org.codice.ddf.commands.catalog.CatalogCommands
org.codice.ddf.commands.catalog.CqlCommands
org.codice.ddf.commands.catalog.DuplicateCommands
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action
- Direct Known Subclasses:
ReplicateCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicIntegerprotected Set<ddf.catalog.data.Metacard>protected AtomicIntegerprotected static final intprotected longFields inherited from class org.codice.ddf.commands.catalog.CqlCommands
DATE_FORMAT, DEFAULT_TEMPORAL_PROPERTYFields inherited from class org.codice.ddf.commands.catalog.CatalogCommands
bundleContext, catalogFramework, catalogProvider, DATETIME_FORMATTER, DEFAULT_NUMBER_OF_ITEMS, DEFAULT_TRANSFORMER_ID, ESCAPE, filterBuilder, isProvider, NAMESPACE, SERIALIZED_OBJECT_ID, SINGLE_WILDCARD, WILDCARDFields inherited from class org.codice.ddf.commands.catalog.SubjectCommands
security, session, userFields inherited from class org.codice.ddf.commands.catalog.CommandSupport
console, ERROR_COLOR, MS_PER_SECOND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidduplicateInBatches(CatalogFacade queryFacade, CatalogFacade ingestFacade, org.geotools.api.filter.Filter filter, String sourceId) In batches, loops through a query of the queryFacade and an ingest to the ingestFacade of the metacards from the response until there are no more metacards from the queryFacade or the maxMetacards has been reached.protected List<ddf.catalog.data.Metacard>ingestMetacards(CatalogFacade provider, List<ddf.catalog.data.Metacard> metacards) protected List<ddf.catalog.data.Metacard>protected voidwriteFailedMetacards(Set<ddf.catalog.data.Metacard> failedMetacardsToWrite) Methods inherited from class org.codice.ddf.commands.catalog.CqlCommands
getFilter, getFilter, getFilterStartTime, getTemporalProperty, hasFilterMethods inherited from class org.codice.ddf.commands.catalog.CatalogCommands
getCatalog, getFormattedDuration, getFormattedDuration, getServiceByFilterMethods inherited from class org.codice.ddf.commands.catalog.SubjectCommands
execute, executeWithSubjectMethods inherited from class org.codice.ddf.commands.catalog.CommandSupport
calculateRecordsPerSecond, printColor, printErrorMessage, printHeaderMessage, printProgressAndFlush, printSuccessMessage
-
Field Details
-
MAX_BATCH_SIZE
protected static final int MAX_BATCH_SIZE- See Also:
-
ingestedCount
-
failedCount
-
failedMetacards
-
start
protected long start
-
-
Constructor Details
-
DuplicateCommands
public DuplicateCommands()
-
-
Method Details
-
duplicateInBatches
protected void duplicateInBatches(CatalogFacade queryFacade, CatalogFacade ingestFacade, org.geotools.api.filter.Filter filter, String sourceId) throws InterruptedException In batches, loops through a query of the queryFacade and an ingest to the ingestFacade of the metacards from the response until there are no more metacards from the queryFacade or the maxMetacards has been reached.- Parameters:
queryFacade- - the CatalogFacade to duplicate fromingestFacade- - the CatalogFacade to duplicate tofilter- - the filter to query with- Throws:
InterruptedException
-
ingestMetacards
protected List<ddf.catalog.data.Metacard> ingestMetacards(CatalogFacade provider, List<ddf.catalog.data.Metacard> metacards) -
subtract
-
writeFailedMetacards
protected void writeFailedMetacards(Set<ddf.catalog.data.Metacard> failedMetacardsToWrite) throws IOException - Throws:
IOException
-