Class MgLocalReconciliationService
java.lang.Object
io.clonecloudstore.reconciliator.database.mongodb.MgLocalReconciliationService
- All Implemented Interfaces:
LocalReconciliationService
@ApplicationScoped
public class MgLocalReconciliationService
extends Object
implements LocalReconciliationService
-
Field Summary
FieldsFields inherited from interface io.clonecloudstore.reconciliator.database.model.LocalReconciliationService
DELETED_RANK, DELETING_RANK, ERR_DEL_RANK, ERR_UPL_RANK, READY_RANK, STATUS_NAME_ORDERED, TO_UPDATE_RANK, UNKNOWN_RANK, UPLOAD_RANK
-
Constructor Summary
ConstructorsConstructorDescriptionMgLocalReconciliationService
(MgDaoAccessorObjectRepository objectRepository, MgDaoNativeListingRepository nativeListingRepository, MgDaoSitesListingRepository sitesListingRepository, MgDaoRequestRepository requestRepository, BulkMetrics bulkMetrics) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanNativeListing
(DaoRequest daoRequest) Used only if NativeListing is not to be keptvoid
cleanSitesListing
(DaoRequest daoRequest) Used only if SitesListing is not to be keptgetSiteListing
(DaoRequest daoRequest) Get the local sites listing to send through network
Step6: get all local sites listing
Index Sites: requestIdvoid
step1CleanUpObjectsNativeListings
(DaoRequest daoPreviousRequest) Clean Up Native Listing and Objects from status Object
Index Objects: Bucket, Site, Status, creationvoid
step1SubStep1CleanUpStatusUnknownObjectsNativeListings
(DaoRequest daoPreviousRequest) Clean Up Native Listing and Objects from status Object
Remove UNKNOWN status
Index Objects: Bucket, Site, Statusvoid
step1SubStep2CleanUpStatusOlderUploadDeleteCheckObjectsNativeListings
(DaoRequest daoPreviousRequest) Clean Up Objects ReconciliationStatus from status Object
Index Objects: Bucket, Site, Status, creationvoid
step1SubStep3CleanUpPreviousErrorUploadAndDeletedNativeListing
(DaoRequest daoPreviousRequest) Clean Up Native Listing from status Object
Remove UNKNOWN, UPLOAD, ERR_UPL, DELETED, ERR_DEL items
Index Objects: Bucket, Site, Statusvoid
step2ContinueFromPreviousRequest
(String requestId, DaoRequest daoRequest, boolean replaceOldRequest) Get Old listing to restart from (for each site): Optional step (if accepting eventual mistakes on old data)
Index Native: requestId, bucket
Step2: Copy NativeListing with new RequestId (or Replace requestId)void
step3SaveNativeListingDb
(DaoRequest daoRequest) Listing according to filter such as now > dateFrom (DB), updating existing info
Step3: From Db Objects into NativeListing local step
Index Objects: site, bucket, event
Index Native: requestId, bucket, namevoid
step4SaveNativeListingDriver
(DaoRequest daoRequest) Listing according to filter such as now > dateFrom (DRIVER), updating existing info Step4: From Driver to Native
Index Native: requestId, bucket, namevoid
step51InsertMissingObjectsFromExistingDriverIntoObjects
(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) void
step52UpsertMissingObjectsFromExistingDriverIntoSiteListing
(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference, BlockingQueue<List<DaoSitesListing>> blockingQueue) void
step53UpdateWhereNoDriverIntoObjects
(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) void
step54UpsertWhereNoDriverIntoSiteListing
(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) void
step55UpdateBothDbDriverIntoObjects
(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) void
step56UpdateBothDbDriverIntoSiteListing
(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference, BlockingQueue<List<DaoSitesListing>> blockingQueue) void
step58CountFinalSiteListing
(DaoRequest daoRequest) void
step5CompareNativeListingDbDriver
(DaoRequest daoRequest) Compare Native listing with DB and DRIVER (both or only one)
Step5: Complete DB without Driver from NativeListing into SitesListing Local step
Index Native: requestId, bucket, db, driver.event (optional)
Index Objects: site, bucket, name
Index Native: requestId, bucket, db.site, driver (optional)
Index Native: requestId, bucket, db.site, driver.site
Index Sites: requestId, bucket, name
-
Field Details
-
LOCAL_RECONCILIATOR
- See Also:
-
-
Constructor Details
-
MgLocalReconciliationService
public MgLocalReconciliationService(MgDaoAccessorObjectRepository objectRepository, MgDaoNativeListingRepository nativeListingRepository, MgDaoSitesListingRepository sitesListingRepository, MgDaoRequestRepository requestRepository, BulkMetrics bulkMetrics)
-
-
Method Details
-
step1CleanUpObjectsNativeListings
Clean Up Native Listing and Objects from status Object
Index Objects: Bucket, Site, Status, creation- Specified by:
step1CleanUpObjectsNativeListings
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-
step1SubStep1CleanUpStatusUnknownObjectsNativeListings
public void step1SubStep1CleanUpStatusUnknownObjectsNativeListings(DaoRequest daoPreviousRequest) throws CcsDbException Clean Up Native Listing and Objects from status Object
Remove UNKNOWN status
Index Objects: Bucket, Site, Status- Throws:
CcsDbException
-
step1SubStep2CleanUpStatusOlderUploadDeleteCheckObjectsNativeListings
public void step1SubStep2CleanUpStatusOlderUploadDeleteCheckObjectsNativeListings(DaoRequest daoPreviousRequest) throws CcsDbException Clean Up Objects ReconciliationStatus from status Object
Index Objects: Bucket, Site, Status, creation- Throws:
CcsDbException
-
step1SubStep3CleanUpPreviousErrorUploadAndDeletedNativeListing
public void step1SubStep3CleanUpPreviousErrorUploadAndDeletedNativeListing(DaoRequest daoPreviousRequest) throws CcsDbException Clean Up Native Listing from status Object
Remove UNKNOWN, UPLOAD, ERR_UPL, DELETED, ERR_DEL items
Index Objects: Bucket, Site, Status- Throws:
CcsDbException
-
step2ContinueFromPreviousRequest
public void step2ContinueFromPreviousRequest(String requestId, DaoRequest daoRequest, boolean replaceOldRequest) throws CcsDbException Get Old listing to restart from (for each site): Optional step (if accepting eventual mistakes on old data)
Index Native: requestId, bucket
Step2: Copy NativeListing with new RequestId (or Replace requestId)- Specified by:
step2ContinueFromPreviousRequest
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-
step3SaveNativeListingDb
Listing according to filter such as now > dateFrom (DB), updating existing info
Step3: From Db Objects into NativeListing local step
Index Objects: site, bucket, event
Index Native: requestId, bucket, name- Specified by:
step3SaveNativeListingDb
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-
step4SaveNativeListingDriver
Listing according to filter such as now > dateFrom (DRIVER), updating existing info Step4: From Driver to Native
Index Native: requestId, bucket, name- Specified by:
step4SaveNativeListingDriver
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-
step5CompareNativeListingDbDriver
Compare Native listing with DB and DRIVER (both or only one)
Step5: Complete DB without Driver from NativeListing into SitesListing Local step
Index Native: requestId, bucket, db, driver.event (optional)
Index Objects: site, bucket, name
Index Native: requestId, bucket, db.site, driver (optional)
Index Native: requestId, bucket, db.site, driver.site
Index Sites: requestId, bucket, name- Specified by:
step5CompareNativeListingDbDriver
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-
step51InsertMissingObjectsFromExistingDriverIntoObjects
public void step51InsertMissingObjectsFromExistingDriverIntoObjects(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) -
step52UpsertMissingObjectsFromExistingDriverIntoSiteListing
public void step52UpsertMissingObjectsFromExistingDriverIntoSiteListing(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference, BlockingQueue<List<DaoSitesListing>> blockingQueue) -
step53UpdateWhereNoDriverIntoObjects
public void step53UpdateWhereNoDriverIntoObjects(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) -
step54UpsertWhereNoDriverIntoSiteListing
public void step54UpsertWhereNoDriverIntoSiteListing(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) -
step55UpdateBothDbDriverIntoObjects
public void step55UpdateBothDbDriverIntoObjects(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) -
step56UpdateBothDbDriverIntoSiteListing
public void step56UpdateBothDbDriverIntoSiteListing(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference, BlockingQueue<List<DaoSitesListing>> blockingQueue) -
step58CountFinalSiteListing
- Throws:
CcsDbException
-
cleanNativeListing
Used only if NativeListing is not to be kept- Specified by:
cleanNativeListing
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-
getSiteListing
Get the local sites listing to send through network
Step6: get all local sites listing
Index Sites: requestId- Specified by:
getSiteListing
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-
cleanSitesListing
Used only if SitesListing is not to be kept- Specified by:
cleanSitesListing
in interfaceLocalReconciliationService
- Throws:
CcsDbException
-