예제 #1
0
            public static void Handle(IClientMessage clientMessage, HandleIMapInvalidation handleIMapInvalidation,
                                      HandleIMapBatchInvalidation handleIMapBatchInvalidation)
            {
                var messageType = clientMessage.GetMessageType();

                if (messageType == EventMessageConst.EventIMapInvalidation)
                {
                    IData key        = null;
                    var   key_isNull = clientMessage.GetBoolean();
                    if (!key_isNull)
                    {
                        key = clientMessage.GetData();
                    }
                    handleIMapInvalidation(key);
                    return;
                }
                if (messageType == EventMessageConst.EventIMapBatchInvalidation)
                {
                    IList <IData> keys      = null;
                    var           keys_size = clientMessage.GetInt();
                    keys = new List <IData>();
                    for (var keys_index = 0; keys_index < keys_size; keys_index++)
                    {
                        IData keys_item;
                        keys_item = clientMessage.GetData();
                        keys.Add(keys_item);
                    }
                    handleIMapBatchInvalidation(keys);
                    return;
                }
                Logger.GetLogger(typeof(AbstractEventHandler))
                .Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
            }
예제 #2
0
            public static void Handle(IClientMessage clientMessage, HandleIMapInvalidation handleIMapInvalidation,
                                      HandleIMapBatchInvalidation handleIMapBatchInvalidation)
            {
                var messageType = clientMessage.GetMessageType();

                if (messageType == EventMessageConst.EventIMapInvalidation)
                {
                    var   IMapInvalidationMessageFinished = false;
                    IData key       = null;
                    var   keyIsNull = clientMessage.GetBoolean();
                    if (!keyIsNull)
                    {
                        key = clientMessage.GetData();
                    }
                    if (!IMapInvalidationMessageFinished)
                    {
                        IMapInvalidationMessageFinished = clientMessage.IsComplete();
                    }
                    string sourceUuid = null;
                    if (!IMapInvalidationMessageFinished)
                    {
                        sourceUuid = clientMessage.GetStringUtf8();
                    }
                    Guid?partitionUuid = null;
                    if (!IMapInvalidationMessageFinished)
                    {
                        partitionUuid = UUIDCodec.Decode(clientMessage);
                    }
                    long?sequence = null;
                    if (!IMapInvalidationMessageFinished)
                    {
                        sequence = clientMessage.GetLong();
                    }
                    handleIMapInvalidation(key, sourceUuid, partitionUuid, sequence);
                    return;
                }
                if (messageType == EventMessageConst.EventIMapBatchInvalidation)
                {
                    var IMapBatchInvalidationMessageFinished = false;
                    var keys     = new List <IData>();
                    var keysSize = clientMessage.GetInt();
                    for (var keysIndex = 0; keysIndex < keysSize; keysIndex++)
                    {
                        var keysItem = clientMessage.GetData();
                        keys.Add(keysItem);
                    }
                    if (!IMapBatchInvalidationMessageFinished)
                    {
                        IMapBatchInvalidationMessageFinished = clientMessage.IsComplete();
                    }
                    IList <string> sourceUuids = null;
                    if (!IMapBatchInvalidationMessageFinished)
                    {
                        sourceUuids = new List <string>();
                        var sourceUuidsSize = clientMessage.GetInt();
                        for (var sourceUuidsIndex = 0; sourceUuidsIndex < sourceUuidsSize; sourceUuidsIndex++)
                        {
                            var sourceUuidsItem = clientMessage.GetStringUtf8();
                            sourceUuids.Add(sourceUuidsItem);
                        }
                    }
                    IList <Guid> partitionUuids = null;
                    if (!IMapBatchInvalidationMessageFinished)
                    {
                        partitionUuids = new List <Guid>();
                        var partitionUuidsSize = clientMessage.GetInt();
                        for (var partitionUuidsIndex = 0;
                             partitionUuidsIndex < partitionUuidsSize;
                             partitionUuidsIndex++)
                        {
                            var partitionUuidsItem = UUIDCodec.Decode(clientMessage);
                            partitionUuids.Add(partitionUuidsItem);
                        }
                    }
                    IList <long> sequences = null;
                    if (!IMapBatchInvalidationMessageFinished)
                    {
                        sequences = new List <long>();
                        var sequencesSize = clientMessage.GetInt();
                        for (var sequencesIndex = 0; sequencesIndex < sequencesSize; sequencesIndex++)
                        {
                            var sequencesItem = clientMessage.GetLong();
                            sequences.Add(sequencesItem);
                        }
                    }
                    handleIMapBatchInvalidation(keys, sourceUuids, partitionUuids, sequences);
                    return;
                }
                Hazelcast.Logging.Logger.GetLogger(typeof(AbstractEventHandler))
                .Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
            }
 public static void Handle(IClientMessage clientMessage, HandleIMapInvalidation handleIMapInvalidation,
     HandleIMapBatchInvalidation handleIMapBatchInvalidation)
 {
     var messageType = clientMessage.GetMessageType();
     if (messageType == EventMessageConst.EventIMapInvalidation)
     {
         IData key = null;
         var key_isNull = clientMessage.GetBoolean();
         if (!key_isNull)
         {
             key = clientMessage.GetData();
         }
         handleIMapInvalidation(key);
         return;
     }
     if (messageType == EventMessageConst.EventIMapBatchInvalidation)
     {
         IList<IData> keys = null;
         var keys_size = clientMessage.GetInt();
         keys = new List<IData>();
         for (var keys_index = 0; keys_index < keys_size; keys_index++)
         {
             IData keys_item;
             keys_item = clientMessage.GetData();
             keys.Add(keys_item);
         }
         handleIMapBatchInvalidation(keys);
         return;
     }
     Logger.GetLogger(typeof (AbstractEventHandler))
         .Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
 }