public void Deserialize(Common.Serialization.IO.CompactReader reader) { this.Type = (StateTransferType)reader.ReadByte(); this.DBName = reader.ReadString(); this.ColName = reader.ReadString(); this.NodeInfo = (NodeIdentity)reader.ReadObject(); this.DistributionType = (DistributionMethod)reader.ReadByte(); }
public StateTransferIdentity(String DBName, String ColName, NodeIdentity nodeInfo, StateTransferType type, Alachisoft.NosDB.Common.Toplogies.Impl.Distribution.DistributionMethod distributionType) { this.DBName = DBName; this.ColName = ColName; this.NodeInfo = nodeInfo; this.Type = type; this.DistributionType = distributionType; }
/// <summary> /// Create a new cluster dictionary, only called internally. /// </summary> internal ClusterDictionary(ConflictResolution conflictResolutionPolicy = ConflictResolution.CHRONOLOGICAL, DistributionMethod clusterDistributionMethod = DistributionMethod.FULLY_DISTRIBUTED, UpdateInterval updateIntervalPolicy = UpdateInterval.IMMEDIATE, Initialization initializationPolicy = Initialization.LAZY) { ConflictResolutionPolicy = conflictResolutionPolicy; ClusterDistributionMethod = clusterDistributionMethod; UpdateIntervalPolicy = updateIntervalPolicy; InitializationPolicy = initializationPolicy; initialize(); }
public virtual IAmountDistributionService <Item> CreateService <Item>(DistributionMethod method, DistributionParameter <Item> distributeParameter) where Item : class, IAmountItem { switch (method) { case DistributionMethod.RemainderToBiggestLine: return(new RemainderToBiggestLineService <Item>(distributeParameter)); case DistributionMethod.RemainderToLastLine: return(new RemainderToLastLineService <Item>(distributeParameter)); case DistributionMethod.AccumulateRemainderToNonZeroLine: return(new RemainderToLastLineService <Item>(distributeParameter)); default: throw new NotImplementedException(); } }
public TableDef(TableSource source, string tabName, List <ColumnDef> columns, string distributedBy) { int npart = 1; Dictionary <string, ColumnDef> cols = new Dictionary <string, ColumnDef>(); foreach (var c in columns) { cols.Add(c.name_, c); } source_ = source; name_ = Utils.normalizeName(tabName); columns_ = cols; Debug.Assert(distMethod_ == DistributionMethod.NonDistributed); if (distributedBy != null) { ColumnDef partcol; if (distributedBy == "REPLICATED") { distMethod_ = DistributionMethod.Replicated; } else if (distributedBy == "ROUNDROBIN") { distMethod_ = DistributionMethod.Roundrobin; } else { cols.TryGetValue(distributedBy, out partcol); if (partcol is null) { throw new SemanticAnalyzeException($"can't find distribution column '{distributedBy}'"); } distMethod_ = DistributionMethod.Distributed; distributedBy_ = partcol; } npart = QueryOption.num_machines_; } for (int i = 0; i < npart; i++) { distributions_.Add(new Distribution()); } Debug.Assert(distributedBy_ is null || distMethod_ == DistributionMethod.Distributed); }
public StateTrxfrOnReplicaTask(NodeContext context, String dbName, String colName, IDispatcher operationDispatcher, DistributionMethod distributionType) : base(context, dbName, colName, operationDispatcher, StateTransferType.INTRA_SHARD, distributionType) { _allowBulkInSparsedBuckets = false; _trasferType = StateTransferType.INTRA_SHARD; }
public Distributor(DistributionMethod method) { Method = method; }