/// <summary> /// Get list of partitions and the offsets at the given location. If the partition is empty, this method returns 0 for all offsets regardless of location. /// Tail is pointing to the offest AFTER the last message, i.e. offset of the message to be written next. /// This function will force fetch requests, i.e. it does not use cached metadata. /// </summary> /// <param name="topic">topic name for which to retrieve offsets for</param> /// <param name="startLocation">The location you're interested in. Pass either TopicHead OR TopicTail, but NOT 'SpecifiedLocations'. </param> /// <returns></returns> public Task <TopicPartitionOffsets> FetchPartitionOffsetsAsync(string topic, ConsumerLocation startLocation) { if (startLocation == ConsumerLocation.SpecifiedLocations) { throw new ArgumentException("startLocation must be either TopicHead or TopicTail"); } return(FetchPartitionOffsetsImplAsync(topic, (long)startLocation)); }
protected override void AssignDefaultValuesToSceneNode(SceneNode node) { base.AssignDefaultValuesToSceneNode(node); if (node is ParticleStormNode c) { c.ParticleCount = ParticleCount; c.EmitterRadius = (float)EmitterRadius; c.ConsumerGravity = (float)ConsumerGravity; c.ConsumerRadius = (float)ConsumerRadius; c.InitialEnergy = (float)InitialEnergy; c.EnergyDissipationRate = (float)EnergyDissipationRate; c.RandomVectorGenerator = RandomVectorGenerator; c.ParticleTexture = ParticleTexture; c.NumTextureColumn = (uint)NumTextureColumn; c.NumTextureRow = (uint)NumTextureRow; c.ParticleSize = new Vector2((float)ParticleSize.Width, (float)ParticleSize.Height); c.InitialVelocity = (float)InitialVelocity; c.CumulateAtBound = CumulateAtBound; c.BlendColor = BlendColor.ToColor4(); c.AnimateSpriteByEnergy = AnimateSpriteByEnergy; c.Turbulance = (float)Turbulance; c.Blend = Blend; c.AlphaBlend = AlphaBlend; c.SourceBlend = SourceBlend; c.DestBlend = DestBlend; c.SourceAlphaBlend = SourceAlphaBlend; c.DestAlphaBlend = DestAlphaBlend; c.SampleMask = SampleMask; c.BlendColor = BlendColor.ToColor4(); #if NETFX_CORE c.EmitterLocation = EmitterLocation; c.ConsumerLocation = ConsumerLocation; c.InitAcceleration = Acceleration; c.DomainBoundMax = ParticleBounds.Maximum; c.DomainBoundMin = ParticleBounds.Minimum; #else c.EmitterLocation = EmitterLocation.ToVector3(); c.ConsumerLocation = ConsumerLocation.ToVector3(); c.InitAcceleration = Acceleration.ToVector3(); c.DomainBoundMax = new Vector3((float)(ParticleBounds.SizeX / 2 + ParticleBounds.Location.X), (float)(ParticleBounds.SizeY / 2 + ParticleBounds.Location.Y), (float)(ParticleBounds.SizeZ / 2 + ParticleBounds.Location.Z)); c.DomainBoundMin = new Vector3((float)(ParticleBounds.Location.X - ParticleBounds.SizeX / 2), (float)(ParticleBounds.Location.Y - ParticleBounds.SizeY / 2), (float)(ParticleBounds.Location.Z - ParticleBounds.SizeZ / 2)); #endif } }
public PartitionFetchState(int partId, ConsumerLocation startLocation, long offset) { PartId = partId; StartLocation = startLocation; Offset = offset; }
/// <summary> /// Get list of partitions and the offsets at the given location. If the partition is empty, this method returns 0 for all offsets regardless of location. /// Tail is pointing to the offest AFTER the last message, i.e. offset of the message to be written next. /// This function will force fetch requests, i.e. it does not use cached metadata. /// </summary> /// <param name="topic">topic name for which to retrieve offsets for</param> /// <param name="startLocation">The location you're interested in. Pass either TopicHead OR TopicTail, but NOT 'SpecifiedLocations'. </param> /// <returns></returns> public Task<TopicPartitionOffsets> FetchPartitionOffsetsAsync(string topic, ConsumerLocation startLocation) { if (startLocation == ConsumerLocation.SpecifiedLocations) throw new ArgumentException("startLocation must be either TopicHead or TopicTail"); return FetchPartitionOffsetsImplAsync(topic, (long) startLocation); }