コード例 #1
0
		public InsertBenchmark(int count, int threads, IImpl impl, int maxKey)
		{
			_count = count;
			_threads = threads;
			_impl = impl;
			_maxKey = maxKey;
		}
コード例 #2
0
ファイル: ConfigurationModule.cs プロジェクト: TaeHunKim/reef
        public ConfigurationModule Set <T>(IImpl <IList <T> > opt, IList <Type> impl)
        {
            ConfigurationModule c = DeepCopy();

            c.ProcessSet(opt);
            c.setImplLists.Add(opt, impl);
            return(c);
        }
コード例 #3
0
 private static void Batch(IImpl impl)
 {
     for (int i = 0; i < batch_size; i++)
     {
         string[][] res = impl.DoTurn(inp);
         Asserts(res);
     }
 }
コード例 #4
0
        public ConfigurationModuleBuilder BindList <U, T>(GenericType <U> iface, IImpl <IList <T> > opt)
            where U : Name <IList <T> >
        {
            ConfigurationModuleBuilder c = DeepCopy();
            Type ifaceType = typeof(U);

            c.ProcessUse(opt);
            c.FreeImpls.Add(ifaceType, opt);
            return(c);
        }
コード例 #5
0
		public RwBenchmark(IImpl impl, double readRatio, int threads, int opsCount, int maxKey)
		{
			_readRatio = readRatio;
			_opsCount = opsCount;
			_threads = threads;
			_readAction = () => impl.Find(Helpers.Random.Value.Next(maxKey));
			_writeAction = () =>
			{
				var buffer = new byte[1024];
				Helpers.Random.Value.NextBytes(buffer);
				impl.Update(Helpers.Random.Value.Next(maxKey), buffer);
			};
		}
コード例 #6
0
		public static void Prepare(IImpl impl, Logger logger, int maxKey)
		{
			logger("starting cleanup");
			impl.Clear();
			logger("Clean");
			var bulksize = 1024;
			var inserted = 0;
			while (inserted < maxKey)
			{
				impl.BulkInsert(inserted, bulksize);
				inserted += bulksize;
			}
			logger("Prepare done, inserted: {0}", maxKey);
		}
コード例 #7
0
        public ConfigurationModuleBuilder BindSetEntry <U, T>(GenericType <U> iface, IImpl <T> opt)
            where U : Name <ISet <T> >
        {
            ConfigurationModuleBuilder c = DeepCopy();
            Type ifaceType = typeof(U);

            c.ProcessUse(opt);
            c.FreeImpls.Add(ifaceType, opt);

            if (!SetOpts.Contains(opt))
            {
                c.SetOpts.Add(opt);
            }
            return(c);
        }
コード例 #8
0
ファイル: ConfigurationModule.cs プロジェクト: TaeHunKim/reef
        public ConfigurationModule Set <T>(IImpl <T> opt, string impl)
        {
            ConfigurationModule c = DeepCopy();

            c.ProcessSet(opt);
            if (c.Builder.SetOpts.Contains(opt))
            {
                c.setLateImplSets.Add(opt, impl);
            }
            else
            {
                c.setLateImpls.Add(opt, impl);
            }
            return(c);
        }
コード例 #9
0
ファイル: ConfigurationModule.cs プロジェクト: TaeHunKim/reef
        public ConfigurationModule Set <T, U>(IImpl <T> opt, GenericType <U> impl)
            where U : T
        {
            Type implType = typeof(U);

            ConfigurationModule c = DeepCopy();

            c.ProcessSet(opt);
            if (c.Builder.SetOpts.Contains(opt))
            {
                c.setImplSets.Add(opt, implType);
            }
            else
            {
                c.setImpls.Add(opt, implType);
            }
            return(c);
        }
コード例 #10
0
        public ConfigurationModuleBuilder BindConstructor <T, U>(GenericType <T> cons, IImpl <U> v)
            where U : IExternalConstructor <T>
        {
            ConfigurationModuleBuilder c = DeepCopy();

            c.ProcessUse(v);
            Type consType = typeof(T);
            var  i        = (IImpl <object>)v;

            c.FreeImpls.Add(consType, i);
            return(c);
        }
コード例 #11
0
        // public final <T> ConfigurationModuleBuilder bindNamedParameter(Class<? extends Name<T>> iface, Impl<? extends T> opt)
        // if ValueType is T, you would better to use public ConfigurationModuleBuilder BindNamedParameter<U, T>(GenericType<U> iface, IImpl<T> opt)
        public ConfigurationModuleBuilder BindNamedParameter <U, V, T>(GenericType <U> iface, IImpl <V> opt)
            where U : Name <T>
            where V : T
        {
            ConfigurationModuleBuilder c = DeepCopy();

            c.ProcessUse(opt);
            Type ifaceType = typeof(U);

            c.FreeImpls.Add(ifaceType, opt);
            return(c);
        }
コード例 #12
0
        public ConfigurationModuleBuilder BindImplementation <U, T>(GenericType <T> iface, IImpl <U> opt)
            where U : T
        {
            ConfigurationModuleBuilder c = DeepCopy();

            c.ProcessUse(opt);
            Type ifaceType = typeof(T);

            c.FreeImpls.Add(ifaceType, opt);
            return(c);
        }
コード例 #13
0
 /// <summary>
 /// 構造器注入
 /// </summary>
 /// <param name="implementor"></param>
 public RefinedAbstraction(IImpl implementor)
 {
     this.Implementor = implementor;
 }