Esempio n. 1
0
        public DTOtupleState getOnProcessingOnOther(TupleWrapper t)
        {
            DTOtupleState output;

            Monitor.Enter(processingOnOther);
            foreach (KeyValuePair <string, Dictionary <string, OtherReplicaTuple> > entry in processingOnOther)
            {
                foreach (Dictionary <string, OtherReplicaTuple> entry2 in processingOnOther.Values)
                {
                    foreach (KeyValuePair <string, OtherReplicaTuple> entry3 in entry2)
                    {
                        if (t.Equals(entry3.Value.getTuple()))
                        {
                            output = new DTOtupleState(entry3.Value, entry.Key);
                            Monitor.Pulse(processingOnOther);
                            Monitor.Exit(processingOnOther);
                            return(output);
                        }
                    }
                }
            }
            Monitor.Pulse(processingOnOther);
            Monitor.Exit(processingOnOther);
            return(null);
        }
Esempio n. 2
0
        public DTOtupleState getTupleState(TupleWrapper tuple)
        {
            if (isOnSeenTuples(tuple))
            {
                return(new DTOtupleState(tuple.ID));
            }

            if (getOnProcessingOnMe(tuple) != null)
            {
                return(new DTOtupleState(tuple, replicaAddress));
            }

            DTOtupleState result = getOnProcessingOnOther(tuple);

            if (result != null)
            {
                return(result);
            }

            if (isOnDeciding(tuple) || isOnAllTuples(tuple))
            {
                return(new DTOtupleState(tuple));
            }

            else
            {
                return(new DTOtupleState());
            }
        }