Exemplo n.º 1
0
        public void executeOperationTest()
        {
            Codec codec = null;                                                                                             // TODO: Initialize to an appropriate value

            byte[] cacheName  = null;                                                                                       // TODO: Initialize to an appropriate value
            int    topologyId = 0;                                                                                          // TODO: Initialize to an appropriate value

            Flag[]                      flags      = null;                                                                  // TODO: Initialize to an appropriate value
            int                         entryCount = 0;                                                                     // TODO: Initialize to an appropriate value
            BulkGetOperation            target     = new BulkGetOperation(codec, cacheName, topologyId, flags, entryCount); // TODO: Initialize to an appropriate value
            Transport                   transport  = null;                                                                  // TODO: Initialize to an appropriate value
            Dictionary <byte[], byte[]> expected   = null;                                                                  // TODO: Initialize to an appropriate value
            Dictionary <byte[], byte[]> actual;

            actual = target.executeOperation(transport);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets bulk data from the cache
        /// </summary>
        /// <typeparam name="K">Key</typeparam>
        /// <typeparam name="V">Value</typeparam>
        /// <param name="size">Number of records</param>
        /// <returns>Dictionary of retrieved data</returns>
        public Dictionary <K, V> getBulk <K, V>(int size)
        {
            transport = transportFactory.getTransport();
            BulkGetOperation            op = operationsFactory.newBulkGetOperation(size);
            Dictionary <byte[], byte[]> result;

            try
            {
                result = op.executeOperation(transport);
            }
            finally
            {
                transportFactory.releaseTransport(transport);
            }
            Dictionary <K, V> toReturn = new Dictionary <K, V>();

            for (int i = 0; i < result.Count; i++)
            {
                V val = (V)serializer.deserialize(result.ElementAt(i).Value);
                K key = (K)serializer.deserialize(result.ElementAt(i).Key);
                toReturn.Add(key, val);
            }
            return(toReturn);
        }