summaryrefslogtreecommitdiff
path: root/content/doc/r3.8.1/apidocs/zookeeper-server/org/apache/zookeeper/server/package-summary.html
blob: 88457b8b40c2ac21d457b12bfc2768bdad33be11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_352) on Wed Jan 25 17:31:45 CET 2023 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.zookeeper.server (Apache ZooKeeper - Server 3.8.1 API)</title>
<meta name="date" content="2023-01-25">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="org.apache.zookeeper.server (Apache ZooKeeper - Server 3.8.1 API)";
        }
    }
    catch(err) {
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/zookeeper/metrics/impl/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../org/apache/zookeeper/server/admin/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/zookeeper/server/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.apache.zookeeper.server</h1>
<div class="docSummary">
<div class="block">ZooKeeper server theory of operation</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ConnectionMXBean.html" title="interface in org.apache.zookeeper.server">ConnectionMXBean</a></td>
<td class="colLast">
<div class="block">This MBean represents a client connection.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DataTreeMXBean.html" title="interface in org.apache.zookeeper.server">DataTreeMXBean</a></td>
<td class="colLast">
<div class="block">Zookeeper data tree MBean.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/NodeHashMap.html" title="interface in org.apache.zookeeper.server">NodeHashMap</a></td>
<td class="colLast">
<div class="block">The interface defined to manage the hash based on the entries in the
 nodes map.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/RequestProcessor.html" title="interface in org.apache.zookeeper.server">RequestProcessor</a></td>
<td class="colLast">
<div class="block">RequestProcessors are chained together to process transactions.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerStats.Provider.html" title="interface in org.apache.zookeeper.server">ServerStats.Provider</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SessionTracker.html" title="interface in org.apache.zookeeper.server">SessionTracker</a></td>
<td class="colLast">
<div class="block">This is the basic interface that ZooKeeperServer uses to track sessions.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SessionTracker.Session.html" title="interface in org.apache.zookeeper.server">SessionTracker.Session</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SessionTracker.SessionExpirer.html" title="interface in org.apache.zookeeper.server">SessionTracker.SessionExpirer</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServerListener.html" title="interface in org.apache.zookeeper.server">ZooKeeperServerListener</a></td>
<td class="colLast">
<div class="block">Listener for the critical resource events.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServerMXBean.html" title="interface in org.apache.zookeeper.server">ZooKeeperServerMXBean</a></td>
<td class="colLast">
<div class="block">ZooKeeper server MBean.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/AuthenticationHelper.html" title="class in org.apache.zookeeper.server">AuthenticationHelper</a></td>
<td class="colLast">
<div class="block">Contains helper methods to enforce authentication</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/BlueThrottle.html" title="class in org.apache.zookeeper.server">BlueThrottle</a></td>
<td class="colLast">
<div class="block">Implements a token-bucket based rate limiting mechanism with optional
 probabilistic dropping inspired by the BLUE queue management algorithm [1].</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ByteBufferInputStream.html" title="class in org.apache.zookeeper.server">ByteBufferInputStream</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ByteBufferOutputStream.html" title="class in org.apache.zookeeper.server">ByteBufferOutputStream</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ConnectionBean.html" title="class in org.apache.zookeeper.server">ConnectionBean</a></td>
<td class="colLast">
<div class="block">Implementation of connection MBean interface.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ContainerManager.html" title="class in org.apache.zookeeper.server">ContainerManager</a></td>
<td class="colLast">
<div class="block">Manages cleanup of container ZNodes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DatadirCleanupManager.html" title="class in org.apache.zookeeper.server">DatadirCleanupManager</a></td>
<td class="colLast">
<div class="block">This class manages the cleanup of snapshots and corresponding transaction
 logs by scheduling the auto purge task with the specified
 'autopurge.purgeInterval'.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DataNode.html" title="class in org.apache.zookeeper.server">DataNode</a></td>
<td class="colLast">
<div class="block">This class contains the data for a node in the data tree.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DataTree.html" title="class in org.apache.zookeeper.server">DataTree</a></td>
<td class="colLast">
<div class="block">This class maintains the tree data structure.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DataTree.ProcessTxnResult.html" title="class in org.apache.zookeeper.server">DataTree.ProcessTxnResult</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DataTreeBean.html" title="class in org.apache.zookeeper.server">DataTreeBean</a></td>
<td class="colLast">
<div class="block">This class implements the data tree MBean.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DigestCalculator.html" title="class in org.apache.zookeeper.server">DigestCalculator</a></td>
<td class="colLast">
<div class="block">Defines how to calculate the digest for a given node.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DumbWatcher.html" title="class in org.apache.zookeeper.server">DumbWatcher</a></td>
<td class="colLast">
<div class="block">A empty watcher implementation used in bench and unit test.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ExpiryQueue.html" title="class in org.apache.zookeeper.server">ExpiryQueue</a>&lt;E&gt;</td>
<td class="colLast">
<div class="block">ExpiryQueue tracks elements in time sorted fixed duration buckets.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/FinalRequestProcessor.html" title="class in org.apache.zookeeper.server">FinalRequestProcessor</a></td>
<td class="colLast">
<div class="block">This Request processor actually applies any transaction associated with a
 request and services any queries.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/NettyServerCnxn.html" title="class in org.apache.zookeeper.server">NettyServerCnxn</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/NettyServerCnxnFactory.html" title="class in org.apache.zookeeper.server">NettyServerCnxnFactory</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/NIOServerCnxn.html" title="class in org.apache.zookeeper.server">NIOServerCnxn</a></td>
<td class="colLast">
<div class="block">This class handles communication with clients using NIO.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/NIOServerCnxnFactory.html" title="class in org.apache.zookeeper.server">NIOServerCnxnFactory</a></td>
<td class="colLast">
<div class="block">NIOServerCnxnFactory implements a multi-threaded ServerCnxnFactory using
 NIO non-blocking socket calls.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/NodeHashMapImpl.html" title="class in org.apache.zookeeper.server">NodeHashMapImpl</a></td>
<td class="colLast">
<div class="block">a simple wrapper to ConcurrentHashMap that recalculates a digest after
 each mutation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ObserverBean.html" title="class in org.apache.zookeeper.server">ObserverBean</a></td>
<td class="colLast">
<div class="block">ObserverBean</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/PrepRequestProcessor.html" title="class in org.apache.zookeeper.server">PrepRequestProcessor</a></td>
<td class="colLast">
<div class="block">This request processor is generally at the start of a RequestProcessor
 change.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/PurgeTxnLog.html" title="class in org.apache.zookeeper.server">PurgeTxnLog</a></td>
<td class="colLast">
<div class="block">this class is used to clean up the
 snapshot and data log dir's.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/RateLogger.html" title="class in org.apache.zookeeper.server">RateLogger</a></td>
<td class="colLast">
<div class="block">This logs the message once in the beginning and once every LOG_INTERVAL.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ReferenceCountedACLCache.html" title="class in org.apache.zookeeper.server">ReferenceCountedACLCache</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/Request.html" title="class in org.apache.zookeeper.server">Request</a></td>
<td class="colLast">
<div class="block">This is the structure that represents a request moving through a chain of
 RequestProcessors.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/RequestThrottler.html" title="class in org.apache.zookeeper.server">RequestThrottler</a></td>
<td class="colLast">
<div class="block">When enabled, the RequestThrottler limits the number of outstanding requests
 currently submitted to the request processor pipeline.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ResponseCache.html" title="class in org.apache.zookeeper.server">ResponseCache</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerCnxn.html" title="class in org.apache.zookeeper.server">ServerCnxn</a></td>
<td class="colLast">
<div class="block">Interface to a Server connection - represents a connection from a client
 to the server.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerCnxnFactory.html" title="class in org.apache.zookeeper.server">ServerCnxnFactory</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerCnxnHelper.html" title="class in org.apache.zookeeper.server">ServerCnxnHelper</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerConfig.html" title="class in org.apache.zookeeper.server">ServerConfig</a></td>
<td class="colLast">
<div class="block">Server configuration storage.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerMetrics.html" title="class in org.apache.zookeeper.server">ServerMetrics</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerStats.html" title="class in org.apache.zookeeper.server">ServerStats</a></td>
<td class="colLast">
<div class="block">Basic Server Statistics</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SessionTrackerImpl.html" title="class in org.apache.zookeeper.server">SessionTrackerImpl</a></td>
<td class="colLast">
<div class="block">This is a full featured SessionTracker.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SessionTrackerImpl.SessionImpl.html" title="class in org.apache.zookeeper.server">SessionTrackerImpl.SessionImpl</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SnapshotComparer.html" title="class in org.apache.zookeeper.server">SnapshotComparer</a></td>
<td class="colLast">
<div class="block">SnapshotComparer is a tool that loads and compares two snapshots with configurable threshold and various filters, and outputs information about the delta.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SnapshotFormatter.html" title="class in org.apache.zookeeper.server">SnapshotFormatter</a></td>
<td class="colLast">
<div class="block">Dump a snapshot file to stdout.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/SyncRequestProcessor.html" title="class in org.apache.zookeeper.server">SyncRequestProcessor</a></td>
<td class="colLast">
<div class="block">This RequestProcessor logs requests to disk.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/TraceFormatter.html" title="class in org.apache.zookeeper.server">TraceFormatter</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/TxnLogEntry.html" title="class in org.apache.zookeeper.server">TxnLogEntry</a></td>
<td class="colLast">
<div class="block">A helper class to represent the txn entry.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/TxnLogProposalIterator.html" title="class in org.apache.zookeeper.server">TxnLogProposalIterator</a></td>
<td class="colLast">
<div class="block">This class provides an iterator interface to access Proposal deserialized
 from on-disk txnlog.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/UnimplementedRequestProcessor.html" title="class in org.apache.zookeeper.server">UnimplementedRequestProcessor</a></td>
<td class="colLast">
<div class="block">Manages the unknown requests (i.e.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/WorkerService.html" title="class in org.apache.zookeeper.server">WorkerService</a></td>
<td class="colLast">
<div class="block">WorkerService is a worker thread pool for running tasks and is implemented
 using one or more ExecutorServices.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/WorkerService.WorkRequest.html" title="class in org.apache.zookeeper.server">WorkerService.WorkRequest</a></td>
<td class="colLast">
<div class="block">Callers should implement a class extending WorkRequest in order to
 schedule work with the service.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZKDatabase.html" title="class in org.apache.zookeeper.server">ZKDatabase</a></td>
<td class="colLast">
<div class="block">This class maintains the in memory database of zookeeper
 server states that includes the sessions, datatree and the
 committed logs.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperCriticalThread.html" title="class in org.apache.zookeeper.server">ZooKeeperCriticalThread</a></td>
<td class="colLast">
<div class="block">Represents critical thread.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperSaslServer.html" title="class in org.apache.zookeeper.server">ZooKeeperSaslServer</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServer.html" title="class in org.apache.zookeeper.server">ZooKeeperServer</a></td>
<td class="colLast">
<div class="block">This class implements a simple standalone ZooKeeperServer.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServerBean.html" title="class in org.apache.zookeeper.server">ZooKeeperServerBean</a></td>
<td class="colLast">
<div class="block">This class implements the ZooKeeper server MBean interface.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServerConf.html" title="class in org.apache.zookeeper.server">ZooKeeperServerConf</a></td>
<td class="colLast">
<div class="block">Configuration data for a <a href="../../../../org/apache/zookeeper/server/ZooKeeperServer.html" title="class in org.apache.zookeeper.server"><code>ZooKeeperServer</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServerMain.html" title="class in org.apache.zookeeper.server">ZooKeeperServerMain</a></td>
<td class="colLast">
<div class="block">This class starts and runs a standalone ZooKeeperServer.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServerShutdownHandler.html" title="class in org.apache.zookeeper.server">ZooKeeperServerShutdownHandler</a></td>
<td class="colLast">
<div class="block">ZooKeeper server shutdown handler which will be used to handle ERROR or
 SHUTDOWN server state transitions, which in turn releases the associated
 shutdown latch.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperThread.html" title="class in org.apache.zookeeper.server">ZooKeeperThread</a></td>
<td class="colLast">
<div class="block">This is the main class for catching all the uncaught exceptions thrown by the
 threads.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooTrace.html" title="class in org.apache.zookeeper.server">ZooTrace</a></td>
<td class="colLast">
<div class="block">This class encapsulates and centralizes tracing for the ZooKeeper server.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation">
<caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Enum</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/DatadirCleanupManager.PurgeTaskStatus.html" title="enum in org.apache.zookeeper.server">DatadirCleanupManager.PurgeTaskStatus</a></td>
<td class="colLast">
<div class="block">Status of the dataDir purge task</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/EphemeralType.html" title="enum in org.apache.zookeeper.server">EphemeralType</a></td>
<td class="colLast">
<div class="block">
 Abstraction that interprets the <code>ephemeralOwner</code> field of a ZNode.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/EphemeralTypeEmulate353.html" title="enum in org.apache.zookeeper.server">EphemeralTypeEmulate353</a></td>
<td class="colLast">
<div class="block">See https://issues.apache.org/jira/browse/ZOOKEEPER-2901

 version 3.5.3 introduced bugs associated with how TTL nodes were implemented.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ExitCode.html" title="enum in org.apache.zookeeper.server">ExitCode</a></td>
<td class="colLast">
<div class="block">Exit code used to exit server</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/NettyServerCnxn.HandshakeState.html" title="enum in org.apache.zookeeper.server">NettyServerCnxn.HandshakeState</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/PrepRequestProcessor.DigestOpCode.html" title="enum in org.apache.zookeeper.server">PrepRequestProcessor.DigestOpCode</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerCnxn.DisconnectReason.html" title="enum in org.apache.zookeeper.server">ServerCnxn.DisconnectReason</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServer.State.html" title="enum in org.apache.zookeeper.server">ZooKeeperServer.State</a></td>
<td class="colLast">&nbsp;</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
<caption><span>Exception Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Exception</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ClientCnxnLimitException.html" title="class in org.apache.zookeeper.server">ClientCnxnLimitException</a></td>
<td class="colLast">
<div class="block">Indicates that the number of client connections has exceeded some limit.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/RequestProcessor.RequestProcessorException.html" title="class in org.apache.zookeeper.server">RequestProcessor.RequestProcessorException</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerCnxn.CloseRequestException.html" title="class in org.apache.zookeeper.server">ServerCnxn.CloseRequestException</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ServerCnxn.EndOfStreamException.html" title="class in org.apache.zookeeper.server">ServerCnxn.EndOfStreamException</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/zookeeper/server/ZooKeeperServer.MissingSessionException.html" title="class in org.apache.zookeeper.server">ZooKeeperServer.MissingSessionException</a></td>
<td class="colLast">&nbsp;</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!--   -->
</a>
<h2 title="Package org.apache.zookeeper.server Description">Package org.apache.zookeeper.server Description</h2>
<div class="block"><h1>ZooKeeper server theory of operation</h1>
ZooKeeperServer is designed to work in standalone mode and also
be extensible so that it can be used to implement the quorum based
version of ZooKeeper.
<p>
ZooKeeper maintains a order when processing requests:
<ul>
<li>All requests will be processed in order.
<li>All responses will return in order.
<li>All watches will be sent in the order that the update takes place.
</ul>
<p>
We will explain the three aspects of ZooKeeperServer: request processing, data
structure maintenance, and session tracking.

<h2>Request processing</h2>

Requests are received by the ServerCnxn. Demarshalling of a request is
done by ClientRequestHandler. After a request has been demarshalled,
ClientRequestHandler invokes the relevant method in ZooKeeper and marshals
the result.
<p>
If the request is just a query, it will be processed by ZooKeeper and returned.
Otherwise, the request will be validated and a transaction will be generated
and logged. This the request will then wait until the request has been logged
before continuing processing.
<p>
Requests are logged as a group. Transactions are queued up and the SyncThread
will process them at predefined intervals. (Currently 20ms) The SyncThread
interacts with ZooKeeperServer the txnQueue. Transactions are added to the
txnQueue of SyncThread via queueItem. When the transaction has been synced to
disk, its callback will be invoked which will cause the request processing to
be completed.

<h2>Data structure maintenance</h2>

ZooKeeper data is stored in-memory. Each znode is stored in a DataNode object.
This object is accessed through a hash table that maps paths to DataNodes.
DataNodes also organize themselves into a tree. This tree is only used for
serializing nodes.
<p>
We guarantee that changes to nodes are stored to non-volatile media before
responding to a client. We do this quickly by writing changes as a sequence
of transactions in a log file. Even though we flush transactions as a group,
we need to avoid seeks as much as possible. Also, since the server can fail
at any point, we need to be careful of partial records.
<p>
We address the above problems by
<ul>
<li>Pre-allocating 1M chunks of file space. This allows us to append to the
file without causing seeks to update file size. It also means that we need
to check for the end of the log by looking for a zero length transaction
rather than simply end of file.
<li>Writing a signature at the end of each transaction. When processing
transactions, we only use transactions that have a valid signature at the end.
</ul>
<p>
As the server runs, the log file will grow quite large. To avoid long startup
times we periodically take a snapshot of the tree of DataNodes. We cannot
take the snapshot synchronously as the data takes a while to write out, so
instead we asynchronously write out the tree. This means that we end up
with a "corrupt" snapshot of the data tree. More formally if we define T
to be the real snapshot of the tree at the time we begin taking the snapshot
and l as the sequence of transactions that are applied to the tree between
the time the snapshot begins and the time the snapshot completes, we write
to disk T+l' where l' is a subset of the transactions in l. While we do not
have a way of figuring out which transactions make up l', it doesn't really
matter. T+l'+l = T+l since the transactions we log are idempotent (applying
the transaction multiple times has the same result as applying the transaction
once). So when we restore the snapshot we also play all transactions in the log
that occur after the snapshot was begun. We can easily figure out where to
start the replay because we start a new logfile when we start a snapshot. Both
the snapshot file and log file have a numeric suffix that represent the
transaction id that created the respective files.

<h2>Session tracking</h2>
Rather than tracking sessions exactly, we track them in batches. That are
processed at fixed intervals. This is easier to implement than exact
session tracking and it is more efficient in terms of performance. It also 
provides a small grace period for session renewal.</div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/zookeeper/metrics/impl/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../org/apache/zookeeper/server/admin/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/zookeeper/server/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2023 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>