Skip to content

Commit f1c80bd

Browse files
committed
some code improvments (mostly adding the next_expiration thing)
1 parent 8755fea commit f1c80bd

File tree

12 files changed

+550
-933
lines changed

12 files changed

+550
-933
lines changed

.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"sparsetable": "c"
4+
}
5+
}

docs/article/lawn.pdf

-204 KB
Binary file not shown.

docs/article/lawn.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ \section{The Lawn Data Structure}
134134

135135
\subsection{Intended Use Cases}
136136

137-
This algorithm was first developed during the writing of a large scale, Stream Processing geographic intersection product using a FastData\cite{GP} model. The data structure was to receive inputs from one or more systems that make use of a very limited range of TTLs.
137+
This algorithm was first developed during the writing of a large scale, Stream Processing geographic intersection product using a FastData\cite{GP} model. The data structure was to receive inputs from one or more systems that make use of a very limited range of TTLs in proportion to the number of concurrent timers they use.
138138

139139
\paragraph{Assumptions and Constraints :}
140140
As this algorithm was designed to operate as the core of a dehydration utility for a single FastData application, where TTLs are usually discrete and variance is low it is intended for use under the assumptions that:
@@ -152,7 +152,7 @@ \subsection{Algorithm}
152152
\begin{algorithm}
153153
\caption{The Lawn Data Store \label{alg:lawn}}
154154
\begin{algorithmic}[1]
155-
\Require{$id$ - a unique identifier of the Timer.\newline $ttl$ - a whole product of $Tick Resolution$ representing the amount of time to wait before triggering the given timer $Payload$ action.\newline $closest\ expiration$ - the minimal (closest) stored trigger expiration time, defaults to -1.}
155+
\Require{$id$ - a unique identifier of the Timer.\newline $ttl$ - a whole product of $Tick Resolution$ representing the amount of time to wait before triggering the given timer $Payload$ action.\newline $closest\ expiration$ - the minimal (closest) stored trigger expiration time, defaults to 0.}
156156
\Statex
157157
\Function{StartTimer}{$id$, $ttl$, $payload$}
158158
\Let{$endtime$}{current time + $ttl$} %\Comment{current time: the local time of the system as a whole product of $Tick Resolution$}
@@ -177,7 +177,7 @@ \subsection{Algorithm}
177177
\State{\textbf{TimerExpired}($T_{id}$)}
178178
\Let{$T$}{\textbf{peek}($q$)}
179179
\EndWhile
180-
\If{$closest\ expiration$ = -1 \newline \textbf{or} $T_{endtime} < closest\ expiration$}
180+
\If{$closest\ expiration$ = 0 \newline \textbf{or} $T_{endtime} < closest\ expiration$}
181181
\Let{$closest\ expiration$}{$T_{endtime}$}
182182
\EndIf
183183
\EndFor
@@ -192,7 +192,7 @@ \subsection{Algorithm}
192192
\Function{DeleteTimer}{$id$}
193193
\Let{$T$}{TimerHash[$id$]}
194194
\If{$T_{endtime} = closest\ expiration$}
195-
\Let{$closest\ expiration$}{-1}
195+
\Let{$closest\ expiration$}{0}
196196
\EndIf
197197
\State{TTLHash[$T_{ttl}$].\textbf{remove}($T$)}
198198
\State{TimerHash.\textbf{remove}($T$)}

docs/article/src/lawn.py

-124
This file was deleted.

docs/article/src/test_load.py

-160
This file was deleted.

0 commit comments

Comments
 (0)