示例#1
0
        /// <summary>
        /// Makes a key and data package form the keys and values of hashtable, for bulk operations
        /// </summary>
        /// <param name="dic">Hashtable containing the keys and values to be packaged</param>
        /// <param name="keys">Contains packaged keys after execution</param>
        /// <param name="data">Contains packaged data after execution</param>
        internal static void PackageKeysExceptions(Hashtable dic, Alachisoft.NCache.Common.Protobuf.KeyExceptionPackageResponse keyExceptionPackage)
        {
            if (dic != null && dic.Count > 0)
            {
                IDictionaryEnumerator enu = dic.GetEnumerator();
                while (enu.MoveNext())
                {
                    Exception ex = enu.Value as Exception;
                    if (ex != null)
                    {
                        keyExceptionPackage.keys.Add((string)enu.Key);

                        Alachisoft.NCache.Common.Protobuf.Exception exc = new Alachisoft.NCache.Common.Protobuf.Exception();
                        exc.message   = ex.Message;
                        exc.exception = ex.ToString();
                        exc.type      = Alachisoft.NCache.Common.Protobuf.Exception.Type.GENERALFAILURE;

                        keyExceptionPackage.exceptions.Add(exc);
                    }
                    // for DS write failed operations
                    if (enu.Value is OperationResult.Status)
                    {
                        OperationResult.Status status = (OperationResult.Status)enu.Value;
                        if (status == OperationResult.Status.Failure || status == OperationResult.Status.FailureDontRemove)
                        {
                            keyExceptionPackage.keys.Add((string)enu.Key);
                            Alachisoft.NCache.Common.Protobuf.Exception message = new Alachisoft.NCache.Common.Protobuf.Exception();
                            message.message   = enu.Value.ToString();
                            message.exception = enu.Value.ToString();
                            message.type      = Alachisoft.NCache.Common.Protobuf.Exception.Type.GENERALFAILURE;
                            keyExceptionPackage.exceptions.Add(message);
                        }
                    }
                }
            }
        }
示例#2
0
 public OperationResult(WriteOperation writeOperation, Status operationStatus, Exception exception)
 {
     this._writeOperation = writeOperation;
     this._status         = operationStatus;
     this._exception      = exception;
 }
示例#3
0
 public OperationResult(WriteOperation writeOperation, Status operationStatus, string errorMessage)
 {
     this._writeOperation = writeOperation;
     this._status         = operationStatus;
     this._errorMessage   = errorMessage;
 }
示例#4
0
 public OperationResult(WriteOperation writeOperation, Status operationStatus)
 {
     this._writeOperation = writeOperation;
     this._status         = operationStatus;
 }