Steve Howell
5a8bccfe08
topic_data.js: Refactor topic history internals.
...
This commit introduces a per-stream topic_history class
inside of topic_data.js to better encapsulate how we store topic
history.
To the callers, nothing changes here. (Some of our non-black-box
node tests change their way of setting up data, though, since the
internal data structures are different.)
The new class has the following improvements:
* We use message_id instead of timestamp as our sorting key.
(We could have done this in a prep commit, but it wouldn't
have made the diff much cleaner here.)
* We use a dictionary instead of a sorted list to store the
data, so that writes are O(1) instead of O(NlogN). Reads
now do sorts, so they're O(NlogN) instead of O(N), but reads
are fairly infrequent. (The main goal here isn't actually
performance, but instead it just simplifies the
implementation.)
* We isolate `topic_history` from the format of the messages.
This prepares us for upcoming changes where updates to the
data structure may come from topic history queries as well
as messages.
* We split out the message-add path from the message-remove
path. This prepares us to eventually get rid of the "count"
mechanism that is kind of fragile and which has to be
bypassed for historical topics.
2017-07-27 14:26:22 -07:00
..
2017-07-26 17:30:25 -07:00
2017-07-27 14:16:57 -07:00
2017-07-24 10:54:47 -07:00
2017-05-18 12:37:03 -07:00
2017-07-16 10:10:06 -07:00
2017-06-13 16:37:49 -07:00
2017-06-13 16:36:11 -07:00
2017-03-09 00:56:37 -08:00
2017-03-07 22:13:01 -08:00
2017-06-07 19:45:46 -05:00
2017-06-15 10:08:31 -07:00
2017-07-25 14:02:12 -07:00
2017-07-22 12:06:00 -07:00
2017-07-18 11:02:05 -07:00
2017-07-07 16:59:23 -07:00
2017-06-27 14:06:59 -04:00
2017-05-24 17:41:40 -07:00
2017-04-24 12:42:06 -07:00
2017-05-08 14:43:49 -07:00
2017-07-25 22:33:22 -04:00
2017-07-26 09:27:17 -07:00
2017-06-21 15:54:09 -04:00
2017-07-24 10:47:16 -07:00
2017-07-24 10:47:16 -07:00
2017-06-13 12:45:40 -07:00
2017-04-21 21:59:22 -07:00
2017-06-25 12:26:42 -04:00
2017-05-11 17:23:53 -07:00
2017-07-27 14:26:22 -07:00
2017-07-26 09:27:17 -07:00
2017-07-05 13:02:41 -07:00
2017-05-09 11:06:10 -07:00
2017-06-19 06:53:25 -04:00
2017-07-14 17:33:09 -07:00
2017-07-27 14:16:57 -07:00
2017-06-02 14:03:56 -07:00
2017-03-18 20:40:34 -07:00
2017-06-15 12:16:27 -07:00
2017-06-27 14:06:59 -04:00
2017-06-13 12:59:33 -07:00
2017-06-22 11:07:30 -04:00
2017-05-29 11:24:46 -07:00
2017-05-29 11:24:46 -07:00
2017-06-07 19:45:46 -05:00
2017-04-05 11:53:52 -07:00
2017-04-06 09:06:14 +05:30
2017-04-26 09:11:44 -07:00
2017-07-26 09:27:17 -07:00
2017-07-27 11:31:33 -07:00
2017-07-27 14:26:22 -07:00
2017-07-04 13:54:33 -07:00
2017-07-21 11:38:25 -07:00
2017-06-29 07:39:20 -04:00
2017-07-03 11:04:20 -04:00
2017-02-22 22:46:44 -08:00
2017-07-27 14:26:22 -07:00
2017-07-14 12:13:35 -07:00
2017-07-27 14:16:57 -07:00
2017-03-25 12:49:14 -07:00
2017-05-17 07:06:32 -07:00
2017-06-27 14:06:59 -04:00
2017-07-05 09:27:43 -07:00
2017-07-27 14:16:57 -07:00
2017-07-18 12:11:43 -07:00
2017-07-17 16:40:28 -07:00
2017-06-23 08:29:20 -04:00
2017-06-01 08:05:37 +00:00
2017-06-15 15:52:42 -04:00
2017-07-21 11:38:25 -07:00
2017-07-27 11:31:33 -07:00
2017-06-19 17:25:06 -04:00
2017-07-21 11:38:25 -07:00
2017-03-07 22:13:01 -08:00
2017-06-01 08:05:37 +00:00
2017-05-16 23:34:45 -07:00
2017-07-27 14:16:57 -07:00
2017-07-21 11:38:25 -07:00
2017-04-22 11:25:54 -07:00
2017-07-27 14:16:57 -07:00
2017-07-27 14:26:22 -07:00
2017-07-24 10:54:47 -07:00
2017-07-24 17:36:50 -07:00
2017-07-24 16:41:22 -07:00
2017-07-07 10:31:43 -07:00
2017-07-08 14:30:45 -07:00
2017-07-14 14:53:24 -07:00
2017-07-21 13:29:27 -07:00
2017-07-27 14:16:57 -07:00
2017-04-06 11:28:36 -07:00
2017-04-06 11:28:36 -07:00
2017-07-24 10:54:47 -07:00
2017-07-24 17:36:50 -07:00
2017-04-17 20:55:42 -07:00
2017-06-13 16:16:17 -04:00
2017-06-20 23:04:46 -04:00
2017-06-30 10:12:31 -04:00
2017-07-27 14:16:57 -07:00
2017-07-18 12:03:16 -07:00
2017-03-05 15:44:43 -08:00
2017-07-07 19:31:47 -07:00
2017-07-27 14:26:22 -07:00
2017-07-24 10:54:47 -07:00
2017-04-25 09:57:32 -07:00
2017-07-24 10:54:47 -07:00
2017-05-29 11:24:46 -07:00
2017-03-25 09:42:49 -07:00
2017-04-28 07:39:52 -07:00
2017-06-12 18:31:04 -04:00
2017-05-15 14:47:41 -07:00
2017-06-26 19:33:25 -04:00
2017-07-25 23:06:58 -07:00
2017-07-27 14:26:22 -07:00
2017-07-27 14:26:22 -07:00
2017-07-27 14:26:22 -07:00
2017-07-13 21:37:56 -07:00
2017-07-26 09:27:17 -07:00
2017-07-09 10:51:19 -04:00
2017-03-22 08:20:21 -07:00
2017-06-15 11:32:13 -04:00
2017-03-22 07:29:42 -07:00
2017-04-24 12:42:06 -07:00
2017-07-21 11:38:25 -07:00
2017-06-22 19:06:32 -04:00
2017-03-19 11:05:45 -07:00
2017-07-07 16:59:23 -07:00
2017-03-18 10:35:52 -07:00
2017-07-07 16:59:23 -07:00
2017-06-03 06:30:01 -06:00
2017-03-21 00:59:17 -07:00
2017-04-28 23:09:32 -07:00
2017-07-04 13:54:33 -07:00