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 TypeMethodDescriptionvoidcleanNativeListing(DaoRequest daoRequest) Used only if NativeListing is not to be keptvoidcleanSitesListing(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: requestIdvoidstep1CleanUpObjectsNativeListings(DaoRequest daoPreviousRequest) Clean Up Native Listing and Objects from status Object
Index Objects: Bucket, Site, Status, creationvoidstep1SubStep1CleanUpStatusUnknownObjectsNativeListings(DaoRequest daoPreviousRequest) Clean Up Native Listing and Objects from status Object
Remove UNKNOWN status
Index Objects: Bucket, Site, Statusvoidstep1SubStep2CleanUpStatusOlderUploadDeleteCheckObjectsNativeListings(DaoRequest daoPreviousRequest) Clean Up Objects ReconciliationStatus from status Object
Index Objects: Bucket, Site, Status, creationvoidstep1SubStep3CleanUpPreviousErrorUploadAndDeletedNativeListing(DaoRequest daoPreviousRequest) Clean Up Native Listing from status Object
Remove UNKNOWN, UPLOAD, ERR_UPL, DELETED, ERR_DEL items
Index Objects: Bucket, Site, Statusvoidstep2ContinueFromPreviousRequest(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)voidstep3SaveNativeListingDb(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, namevoidstep4SaveNativeListingDriver(DaoRequest daoRequest) Listing according to filter such as now > dateFrom (DRIVER), updating existing info Step4: From Driver to Native
Index Native: requestId, bucket, namevoidstep51InsertMissingObjectsFromExistingDriverIntoObjects(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) voidstep52UpsertMissingObjectsFromExistingDriverIntoSiteListing(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference, BlockingQueue<List<DaoSitesListing>> blockingQueue) voidstep53UpdateWhereNoDriverIntoObjects(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) voidstep54UpsertWhereNoDriverIntoSiteListing(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) voidstep55UpdateBothDbDriverIntoObjects(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference) voidstep56UpdateBothDbDriverIntoSiteListing(DaoRequest daoRequest, AtomicReference<CcsDbException> exceptionAtomicReference, BlockingQueue<List<DaoSitesListing>> blockingQueue) voidstep58CountFinalSiteListing(DaoRequest daoRequest) voidstep5CompareNativeListingDbDriver(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:
step1CleanUpObjectsNativeListingsin 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:
step2ContinueFromPreviousRequestin 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:
step3SaveNativeListingDbin 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:
step4SaveNativeListingDriverin 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:
step5CompareNativeListingDbDriverin 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:
cleanNativeListingin interfaceLocalReconciliationService- Throws:
CcsDbException
-
getSiteListing
Get the local sites listing to send through network
Step6: get all local sites listing
Index Sites: requestId- Specified by:
getSiteListingin interfaceLocalReconciliationService- Throws:
CcsDbException
-
cleanSitesListing
Used only if SitesListing is not to be kept- Specified by:
cleanSitesListingin interfaceLocalReconciliationService- Throws:
CcsDbException
-