Skip to content

Releases: twitter/util

Util 6.35.0

08 Jul 18:28

Choose a tag to compare

Changes in Runtime Behavior:

  • util-codec: StringEncoder no longer depends on apache commons-codec, and
    decode will now throw an exception when it fails to decode a byte, instead
    of failing silently. RB_ID=833478
  • util-collection: LruMap is now backed by jdk LinkedHashMap instead of apache
    collections LRUMap. RB_ID=833515
  • util-core: com.twitter.util.NonFatal is now implemented by Scala's
    scala.util.control.NonFatal. This changes behavior such that
    java.lang.StackOverflowError is considered fatal and
    java.lang.NoSuchMethodException is considered non-fatal.
    RB_ID=835671

New Features:

  • util-app: com.twitter.finagle.util.LoadService has been moved to
    c.t.app.LoadService and can now be used without needing a finagle-core
    dependency. RB_ID=829897
  • util-cache: Adds support for Caffeine-style caches. RB_ID=833848
  • util-core: Add c.t.concurrent.Scheduler.blockingTimeNanos which tracks time spent doing
    blocking operations. RB_ID=828289
  • util-core: Reduced allocations by 40% and latency by 18% of satisfying Promises.
    RB_ID=832816
  • util-core: c.t.util.NoStacktrace is removed. Use scala.util.control.NoStackTrace instead.
    RB_ID=833188
  • util-core: Add Future.joinWith that also accepts a function (A, B) => C for mapping
    a joined result. RB_ID=838169
  • util-core: Add Future.by(Time), complementary to the existing Future.within(Duration)
    RB_ID=838169
  • util-core: Add c.t.util.ProxyTimer which allows for creating proxy based
    Timers outside of the com.twitter.util package. RB_ID=846194
  • util-core: Add AsyncStream.merge merge potentially inifite streams
    RB_ID=846681
  • util-security: Added new project. RB_ID=843070

API Changes:

  • Builds are now only for Java 8 and Scala 2.11. See the
    blog post <https://finagle.github.io/blog/2016/04/20/scala-210-and-java7/>_
    for details. RB_ID=828898
  • util-core: c.t.u.Bijection is removed. use c.t.bijection.Bijection
    (https://github.com/twitter/bijection) instead. RB_ID=834383
  • util-core: Deprecated method Future.get() has been removed because it made it
    too easy to hide blocking code. Replaced usage with the more explicit
    com.twitter.util.Await.result(Future). RB_ID=833579
  • util-core: Deprecated method Future.get(Duration): Try has been removed because it
    made it too easy to hide blocking code. Replaced usage with the more explicit
    com.twitter.util.Await.result(Future.liftToTry). RB_ID=836066
  • util-core: Deprecated methods Future.isReturn and Future.isThrow have been
    removed because they made it too easy to hide blocking code. Replaced usage with
    the more explicit Await.result(Future.liftToTry).isReturn and
    Await.result(Future.liftToTry).isThrow. RB_ID=837329
  • util-lint: Added methods com.twitter.util.lint.Rules.removeById(String) and
    com.twitter.util.lint.RulesImpl.removeById(String) so that it is now possible
    to remove a com.twitter.util.lint.Rule from the com.twitter.util.lint.GlobalRules
    set. RB_ID=840753

Bug Fixes:

  • util-core: AsyncMeter had a bug where if the burst size was smaller than
    the number of disbursed tokens, it would discard all of the tokens over
    the disbursal limit. Changed to instead process tokens in the wait queue
    with leftover tokens. This improves behavior where the actual period is
    smaller than can actually be simulated with the given timer. RB_ID=836742
  • util-core: Once didn't actually provide the guarantee it tried to, because
    of an issue with the scala compiler,
    https://issues.scala-lang.org/browse/SI-9814. It should now actually be
    synchronized. RB_ID=842245
  • util-zk: Fixed race when an existing permit is released between the time
    the list was gotten and the data was checked. RB_ID=835856
  • util-core: Memoize apply now throws IllegalStateException if a thread
    re-enters with identical input parameters instead of deadlocking.

Util 6.34.0

27 Apr 23:03

Choose a tag to compare

Note: This is the final release that will support Scala 2.10 and Java 7.

New Features:

  • util-core: Add Throwables.unchecked to help Java users deal with checked
    exceptions. RB_ID=811441
  • util-stats: Can now get from a com.twitter.finagle.stats.StatsReceiver to all "leaf"
    StatsReceivers that don't delegate to another StatsReceiver with
    com.twitter.finagle.stats.DelegatingStatsReceiver.all. RB_ID=819519

API Changes:

  • util-core: Removed deprecated methods from Buf.scala RB_ID=809948
    • Removed c.t.io.Buf.ByteArray.apply, replace usage with Buf.ByteArray.Owned.apply.
    • Removed c.t.io.Buf.ByteArray.unapply, replace usage with Buf.ByteArray.Owned.unapply.
    • Removed c.t.io.Buf.ByteBuffer.apply, replace usage with Buf.ByteBuffer.Owned.apply.
    • Removed c.t.io.Buf.toByteBuffer, replace usage with Buf.ByteBuffer.Owned.extract.
  • util-core: Removed deprecated Future.apply methods RB_ID=811617
  • util-stats: Removed com.twitter.finagle.stats.BroadcastStatsReceiver marker trait in favor of
    com.twiter.finagle.stats.DelegatingStatsReceiver marker trait, which lets us specify that we
    only delegate to a single com.twitter.finagle.stats.StatsReceiver. RB_ID=819519
  • util-zk-common: Removed com.twitter.zk.ServerSet. Use implementations of ServerSets in the
    finagle-serversets project. RB_ID=821355

Bug Fixes:

  • util-core: Fix memory leak in Var.apply(T, Event[T]) and Var.patch.
    RB_ID=809100

Util 6.33.0

11 Mar 06:57

Choose a tag to compare

New Features:

  • util-core: AsyncSemaphore supports closing and draining of waiters via fail. RB_ID=807590
  • util-core: Add convenience methods force, size, sum, and withEffect to AsyncStream.
    RB_ID=808411

Bug Fixes:

  • util-core: Fix nested functions AsyncStream.++ to avoid stack overflow. RB_ID=804408

Deprecations:

  • util-core: Future.rawException is deprecated in favor of Future.exception.
    RB_ID=798223

Util 6.32.0

08 Mar 04:31

Choose a tag to compare

New Features:

  • util-core: Add Future.traverseSequentially. Take a sequence and sequentially apply a function
    A => Future[B] to each item. RB_ID=785091

Util 6.30.0

08 Mar 04:31

Choose a tag to compare

New Features:

  • util-core: Introduce an AsyncMeter for asynchronously rate limiting to a fixed rate over time.
    It can be used for smoothing out bursty traffic, or for slowing down access to a
    resource. RB_ID=756333
  • util-core: Introduce a TokenBucket for helping to control the relative rates of two processes,
    or for smoothing out the rate of a single process. RB_ID=756333

API Changes:

  • util-core: Timer now has final implementations for schedule which delegate
    to new protected scheduleOnce and schedulePeriodically methods. This is
    done to ensure that Locals are captured when the task is scheduled and
    then used when the task is run. Existing Timer implementations should rename
    their existing schedule methods to work with the new interface. RB_ID=755387
  • util-core: Remove deprecated FuturePool.defaultPool, callers should
    use FuturePool.unboundedPool instead. RB_ID=757499
  • util-stats: Remove deprecated methods on com.twitter.finagle.stats.StatsReceiver.
    RB_ID=757414
  • util-core: AsyncStream graduates out of com.twitter.concurrent.exp into
    com.twitter.concurrent. Backwards compatibility aliases remain for Scala
    users, but Java users will need to update their imports. RB_ID=758061
  • util-codec: Add a new encoder com.twitter.util.Base64UrlSafeStringEncoder
    which extends from com.twitter.util.Base64StringEncoder. Both the url-safe
    and non-url-safe encoders can decode all strings generated by either. RB_ID=765189
  • util-core: Remove unnecessary invalidate method from util-cache's
    com.twitter.cache.guava.LoadingFutureCache, and change the remove semantic
    to match the com.twitter.cache.FutureCache contract. RB_ID=766988
  • util-core: Remove protected Timer.monitor (overrides a monitor to use by a
    timer implementation) because any possible implementation rather than Monitor.get
    promotes memory leaks when timer is used to schedule recursive tasks (tasks that
    reschedules themselves). RB_ID=771736

Util 6.29.0

08 Mar 04:30

Choose a tag to compare

New Features:

  • util-core: Introduce an optional max capacity to AsyncQueue.
    Modified AsyncQueue.offer to return a boolean indicating whether or not the
    item was accepted. Added AsyncQueue.drain(): Try[Queue]. ``RB_ID=745567`

API Changes:

  • util-core: Remove deprecated methods from com.twitter.util.Time and
    com.twitter.util.Duration. RB_ID=751771
  • util-core: Provide methods on Stopwatch so that users can take advantage of
    Time manipulation tools in latency-sensitive code when measuring elapsed
    time. RB_ID=75268

Changes in Runtime Behavior:

  • util-core: The Scheduler clock stats were decommissioned as they only make sense
    relative to wallTime and the tracking error we have experienced wallTime and
    *Time make it impossible to use them reliably. It is not worth the performance
    and code complexity to support them. RB_ID=750239
  • util-core: JavaTimer and ScheduledThreadPoolTimer now capture the Local
    state when scheduled and is used along with that Monitor when the TimerTask
    is run. RB_ID=755387
  • util-logging: QueueingHandler does not create a separate thread per instance.
    ``RB_ID=745567`

Util 6.28.0

08 Mar 04:30

Choose a tag to compare

API Changes:

  • util-core: Remove deprecated methods from com.twitter.util.Var.

    To migrate observe and foreach, given aVar.observe { t => somethingWith(t) }
    you would write aVar.changes.register(Witness({ t => somethingWith(t) })).

    To migrate observeUntil, given aVar.observeUntil(_ == something),
    you would write aVar.changes.filter(_ == something).toFuture().

    To migrate observeTo, given aVar.observeTo(anAtomicReference),
    you would write aVar.changes.register(Witness(anAtomicReference)).

    RB_ID=744282

Util 6.27.0

08 Mar 04:30

Choose a tag to compare

API Changes:

  • util-core: TimeFormat optionally takes a TimeZone in the constructor.
    If not provided, it uses UTC.

Util 6.26.0

08 Mar 04:29

Choose a tag to compare

API Changes:

  • util-core: Activity, BoundedStack, RingBuffer and Var migrated
    off of deprecated ClassManifest to ClassTag. RB_ID=720455
  • util-core: Added Spool#zip
  • util-core: Removed deprecated methods Future.void and Future$.void().
    Use Future.voided and Future$.Void instead. RB_ID=720427

Changes in Runtime Behavior:

  • util-core: Promise.forwardInterruptsTo(other) is a no-op if the
    other future is fulfilled. RB_ID=714420
  • util-events: Recording of events is disabled by default and can be updated
    at runtime via TwitterServer's /admin/events page or
    /admin/events/{recordOn,recordOff}. RB_ID=715712

Util 6.25.0

08 Mar 04:29

Choose a tag to compare

Changes in Runtime Behavior:

  • util-events: Enable event sink by default.