public InsertBenchmark(int count, int threads, IImpl impl, int maxKey) { _count = count; _threads = threads; _impl = impl; _maxKey = maxKey; }
public ConfigurationModule Set <T>(IImpl <IList <T> > opt, IList <Type> impl) { ConfigurationModule c = DeepCopy(); c.ProcessSet(opt); c.setImplLists.Add(opt, impl); return(c); }
private static void Batch(IImpl impl) { for (int i = 0; i < batch_size; i++) { string[][] res = impl.DoTurn(inp); Asserts(res); } }
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); }
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); }; }
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); }
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); }
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); }
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); }
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); }
// 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); }
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); }
/// <summary> /// 構造器注入 /// </summary> /// <param name="implementor"></param> public RefinedAbstraction(IImpl implementor) { this.Implementor = implementor; }