Task <IList <TableResult> > ExecuteExportedMirrorBatchAsync(TableBatchOperation batch, IList <TableResult> originalResponse) { var exportedBatch = new TableBatchOperation(); var exportedOriginalResponse = new List <TableResult>(); for (int i = 0; i < batch.Count; i++) { TableOperation op = batch[i]; var mtableEntity = (MTableEntity)op.GetEntity(); if (MigratingTable.RowKeyIsInternal(mtableEntity.RowKey)) { continue; } exportedOriginalResponse.Add(originalResponse[i]); Debug.Assert(op.GetOperationType() == TableOperationType.InsertOrReplace); DynamicTableEntity exported = mtableEntity.Export <DynamicTableEntity>(); if (mtableEntity.deleted) { exported.ETag = ChainTable2Constants.ETAG_DELETE_IF_EXISTS; exportedBatch.Delete(exported); } else { exported.ETag = null; exportedBatch.InsertOrReplace(exported); } } return(referenceTable.ExecuteMirrorBatchAsync(exportedBatch, exportedOriginalResponse)); }
internal QueryStream(MigratingTable outer, TableQuery <TElement> query, TableRequestOptions requestOptions, OperationContext operationContext) { this.outer = outer; origFilterExpr = ChainTableUtils.ParseFilterString(query.FilterString); mtableQuery = ChainTableUtils.CopyQuery <TElement, MTableEntity>(query); this.requestOptions = requestOptions; this.operationContext = operationContext; }
internal override void Initialize(MachineId machineId, AppMachineInitializePayload payload) { base.Initialize(machineId, payload); configService = payload.configService; migratingTable = new MigratingTable(configService, payload.oldTable, payload.newTable, new ChainTableMonitor(this), MigrationModel.GetEnabledBug()); InitializeHooks(); }
internal override void Initialize(MachineId machineId, AppMachineInitializePayload payload) { base.Initialize(machineId, payload); migratingTable = new MigratingTable(payload.configService, payload.oldTable, payload.newTable, new ChainTableMonitor(this)); }