Пример #1
0
 private void StopLoggingOnReplica(LoggingIdentity identity)
 {
     if (Context.OperationLog != null)
     {
         Context.OperationLog.StopLogging(identity);
     }
 }
Пример #2
0
 private ICollection GetLoggedOperations(OperationId operationId, LoggingIdentity identity)
 {
     //if (Context.OperationLog != null)
     //{
     //    return Context.OperationLog.GetLoggedOperations(identity,operationId);
     //}
     return(null);
 }
Пример #3
0
 private ICollection GetLoggedOperations(OperationId operationId, LoggingIdentity identity)
 {
     if (Context.OperationLog != null)
     {
         return(Context.OperationLog.GetLoggedOperations(identity, operationId));
     }
     return(null);
 }
Пример #4
0
        private object RemoveLoggedOperations(int bucketID)
        {
            LoggingIdentity identity = new LoggingIdentity(taskIdentity.DBName, taskIdentity.ColName, bucketID);

            if (Context.OperationLog != null)
            {
                return(Context.OperationLog.RemoveLoggedOperations(identity));
            }
            return(null);
        }
Пример #5
0
        public override bool Equals(object obj)
        {
            LoggingIdentity other = obj as LoggingIdentity;

            if (other != null)
            {
                if (DBName != null && DBName.Equals(other.DBName) && ColName != null && ColName.Equals(other.ColName) && BucketID == other.BucketID)
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #6
0
        /// <summary>
        /// Remove Log Table from oplog for provided bucket id
        /// </summary>
        /// <param name="bucketID"></param>
        //private void RemoveLoggedOperations(int bucketID)
        //{
        //    IStateTransferOperation operation = this.CreateStateTransferOperation(StateTransferOpCode.RemoveLoggedOperations);
        //    operation.Params.SetParamValue(ParamName.BucketID, bucketID);

        //    operationDispatcher.DispatchOperation<Object>(operation);
        //}

        protected override void EndBucketsStateTxfr(ArrayList buckets)
        {
            if (buckets != null)
            {
                LoggingIdentity identity = new LoggingIdentity(taskIdentity.DBName, taskIdentity.ColName, (int)buckets[0]);
                StopLoggingOnReplica(identity);
                ICollection loggedOperations = GetLoggedOperations(_startedFrom, identity);


                //STD: Apply logged operations on collection
                ApplyLogOperation(loggedOperations as ClusteredArrayList);

                RemoveLoggedOperations((int)buckets[0]);
            }
        }
Пример #7
0
        private StateTxfrInfo GetLoggedData(int bucketId)
        {
            ICollection   logTbl = null;
            StateTxfrInfo info   = null;

            try
            {
                LoggingIdentity identity = new LoggingIdentity(corresponderIdentity.DBName, corresponderIdentity.ColName, bucketId);
                logTbl = GetLoggedOperations(_startedFrom, identity);
                if (logTbl != null)
                {
                    info            = new StateTxfrInfo(logTbl, true, 0);
                    info.loggedData = true;

                    if (LoggerManager.Instance.StateXferLogger != null && LoggerManager.Instance.StateXferLogger.IsDebugEnabled)
                    {
                        LoggerManager.Instance.StateXferLogger.Debug(loggingModule + ".GetLoggedData()", info == null ? "returning null state-txfr-info" : "returning " + info.data.Count.ToString() + " items in state-txfr-info");
                    }
                    return(info);
                }
                else
                if (LoggerManager.Instance.StateXferLogger != null && LoggerManager.Instance.StateXferLogger.IsDebugEnabled)
                {
                    LoggerManager.Instance.StateXferLogger.Debug(loggingModule + ".GetLoggedData", "no logged data found");
                }
            }
            catch (Exception e)
            {
                if (LoggerManager.Instance.StateXferLogger != null && LoggerManager.Instance.StateXferLogger.IsErrorEnabled)
                {
                    LoggerManager.Instance.StateXferLogger.Error(loggingModule + ".GetLoggedData", e.ToString());
                }
                throw;
            }

            //muds:
            //no operation has been logged during state transfer.
            //so announce completion of state transfer for this bucket.
            return(new StateTxfrInfo(new HashVector(), true, 0));
        }