Twitter Util v19.2.0 Release Notes

Release Date: 2019-02-21 // about 5 years ago
  • ๐Ÿ†• New Features

    • โšก๏ธ util-core: updated Reader#fromFuture to resolve its onClose when reading of end-of-stream.
      f2a05474
    • util-core: Added Reader.flatten to flatten a Reader[Reader[_]] to Reader[_],
      and Reader.fromSeq to create a new Reader from a Seq. a49bab4d
    • util-core: Added Duration.fromMinutes to return a Duration from a given number of minutes.
      eda0b390
    • util-core: If given a Timer upon construction, c.t.io.Pipe will respect the close
      deadline and wait the given amount of time for any pending writes to be read. 0a142872
    • ๐ŸŽ util-core: Optimized ConstFuture.proxyTo which brings the performance of
      flatMap and transform of a ConstFuture in line with map. de4cebda
    • โฑ util-core: Experimental toggle (com.twitter.util.BypassScheduler) for speeding up
      ConstFuture.map (transformTry). The mechanism, when turned on, runs map operations
      โฑ immediately (why not when we have a concrete value), instead of via the Scheduler, where it may
      be queued and potentially reordered, e.g.:
      ๐Ÿ–จ f.flatMap { _ => println(1); g.map { _ => println(2) }; println(3) } will print 1 2 3,
      ๐Ÿ–จ where it would have printed 1 3 2. aeafba1a
    • ๐Ÿ”’ util-security: Pkcs8KeyManagerFactory now supports a certificates file which contains multiple
      certificates that are part of the same certificate chain. 337e270f

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  util-core: Fixed the behavior in c.t.io.Reader where Reader#flatMap fails to propagate
      parent reader's onClose. f2a05474

    โš™ Runtime Behavior Changes

    • util-core: Closing a c.t.io.Pipe will notify onClose when the deadline has passed whereas
      before the pipe would wait indefinitely for a read before transitioning to the Closed state.
      0a142872
    • ๐Ÿš€ util-core: Don't allow AsyncSemaphore Permits to be released multiple times. Before it was
      ๐Ÿš€ possible to release a permit more than once and incorrectly remove waiters from the queue.
      ๐Ÿš€ With this change, the release permit operation is idempotent. ea24c951

    ๐Ÿ’ฅ Breaking API Changes

    • ๐Ÿšš util-core: Remove c.t.u.CountDownLatch which is an extremely thin shim around
      j.u.c.CountDownLatch that provides pretty limited value. To migrate to j.u.c.CountDownLatch,
      instead of c.t.u.CountDownLatch#await(Duration), please use
      j.u.c.CountDownLatch#await(int, TimeUnit), and instead of
      ๐Ÿ‘ป c.t.u.CountDownLatch#within(Duration), please throw an exception yourself after awaiting.
      b9914f15
    • ๐Ÿ—„ util-core: Deprecated conversions in c.t.conversions have new implementations
      that follow a naming scheme of SomethingOps. df397f53
      • percent is now PercentOps
      • storage is now StorageUnitOps
      • string is now StringOps
      • thread is now ThreadOps
      • time is now DurationOps
      • u64 is now U64Ops
    • util-collection: Delete util-collection. We deleted GenerationalQueue, MapToSetAdapter, and
      ImmutableLRU, because we found that they were of little utility. We deleted LruMap because it
      ๐Ÿšš was a very thin shim around a j.u.LinkedHashMap, where you override removeEldestEntry. If you
      ๐Ÿ”€ need SynchronizedLruMap, you can wrap your LinkedHashMap with
      ๐Ÿ”€ j.u.Collection.synchronizedMap. We moved RecordSchema into finagle-base-http because it was
      ๐Ÿ“ฆ basically only used for HTTP messages, so its new package name is c.t.f.http.collection.
      60eff0a4
    • util-core: Rename BlacklistStatsReceiver to DenylistStatsReceiver. ed3f7069
    • util-core: Buf.Composite is now private. Program against more generic, Buf interface instead.
      41e24395