UNPKG

26.5 kBJavaScriptView Raw
1// Generated by CoffeeScript 1.8.0
2(function() {
3 var AbstractChainedBatch, AbstractError, AbstractIterator, AbstractNoSQL, AbstractObject, CloseError, Codec, Errors, InvalidArgumentError, NotImplementedError, OpenError, inherits, isArray, isFunction, isString, setImmediate, utf8ByteLength, xtend;
4
5 xtend = require("xtend");
6
7 AbstractObject = require("abstract-object");
8
9 Codec = require("buffer-codec");
10
11 utf8ByteLength = Codec.getByteLen;
12
13 Errors = require("./abstract-error");
14
15 try {
16 AbstractIterator = require("abstract-iterator");
17 } catch (_error) {}
18
19 AbstractChainedBatch = require("./abstract-chained-batch");
20
21 setImmediate = global.setImmediate || process.nextTick;
22
23 AbstractError = Errors.AbstractError;
24
25 NotImplementedError = Errors.NotImplementedError;
26
27 InvalidArgumentError = Errors.InvalidArgumentError;
28
29 OpenError = Errors.OpenError;
30
31 CloseError = Errors.CloseError;
32
33 inherits = require("abstract-object/lib/util/inherits");
34
35 isString = require("abstract-object/lib/util/isString");
36
37 isFunction = require("abstract-object/lib/util/isFunction");
38
39 isArray = require("abstract-object/lib/util/isArray");
40
41 module.exports = AbstractNoSQL = (function() {
42 inherits(AbstractNoSQL, AbstractObject);
43
44 function AbstractNoSQL() {
45 AbstractNoSQL.__super__.constructor.apply(this, arguments);
46 }
47
48 AbstractNoSQL.prototype.initialize = function(location) {
49 if (location && typeof location !== "string") {
50 throw new InvalidArgumentError("constructor requires a location string argument");
51 }
52 return this.location = location;
53 };
54
55 AbstractNoSQL.prototype.finalize = function() {
56 if (this._opened) {
57 if (this._closeSync) {
58 this.closeSync();
59 } else {
60 this.closeAsync();
61 }
62 }
63 return this._options = null;
64 };
65
66 AbstractNoSQL.prototype.__defineGetter__("opened", function() {
67 return !!this._opened;
68 });
69
70 AbstractNoSQL.prototype.setOpened = function(aValue, options) {
71 if (aValue) {
72 this._opened = true;
73 if (options) {
74 this._options = options;
75 }
76 this.emit("ready");
77 return this.emit("open");
78 } else {
79 this._opened = false;
80 return this.emit("closed");
81 }
82 };
83
84 AbstractNoSQL.prototype.isExistsSync = function(key, options) {
85 var err, result;
86 if (options == null) {
87 options = {};
88 }
89 if (!this._isBuffer(key)) {
90 key = String(key);
91 }
92 if (this._isExistsSync) {
93 result = this._isExistsSync(key, options);
94 return result;
95 } else if (this._getSync) {
96 try {
97 this._getSync(key, options);
98 return true;
99 } catch (_error) {
100 err = _error;
101 if (AbstractError.isNotFound(err)) {
102 return false;
103 } else {
104 throw err;
105 }
106 }
107 }
108 throw new NotImplementedError();
109 };
110
111 AbstractNoSQL.prototype.isExistSync = AbstractNoSQL.prototype.isExistsSync;
112
113 AbstractNoSQL.prototype.getSync = function(key, options) {
114 var err, result;
115 if (this._getSync) {
116 if (options == null) {
117 options = {};
118 }
119 if (err = this._checkKey(key, "key")) {
120 throw err;
121 }
122 if (!this._isBuffer(key)) {
123 key = String(key);
124 }
125 result = this._getSync(key, options);
126 return result;
127 }
128 throw new NotImplementedError();
129 };
130
131 AbstractNoSQL.prototype.getBufferSync = function(key, destBuffer, options) {
132 var result;
133 if (this._getBufferSync) {
134 if (options == null) {
135 options = {};
136 }
137 if (options.offset == null) {
138 options.offset = 0;
139 }
140 result = this._getBufferSync(key, destBuffer, options);
141 return result;
142 }
143 throw new NotImplementedError();
144 };
145
146 AbstractNoSQL.prototype.mGetSync = function(keys, options) {
147 var arr, i, needKeyName, result;
148 if (this._mGetSync) {
149 if (options == null) {
150 options = {};
151 }
152 options.raiseError = options.raiseError !== false;
153 needKeyName = options.keys;
154 arr = this._mGetSync(keys, options);
155 i = 0;
156 result = [];
157 while (i < arr.length) {
158 if (needKeyName !== false) {
159 result.push({
160 key: arr[i],
161 value: arr[++i]
162 });
163 } else {
164 result.push(arr[i]);
165 }
166 i++;
167 }
168 return result;
169 }
170 throw new NotImplementedError();
171 };
172
173 AbstractNoSQL.prototype.putSync = function(key, value, options) {
174 var result;
175 if (this._putSync) {
176 if (options == null) {
177 options = {};
178 }
179 result = this._putSync(key, value, options);
180 return result;
181 }
182 throw new NotImplementedError();
183 };
184
185 AbstractNoSQL.prototype.delSync = function(key, options) {
186 var result;
187 if (this._delSync) {
188 if (options == null) {
189 options = {};
190 }
191 result = this._delSync(key, options);
192 return result;
193 }
194 throw new NotImplementedError();
195 };
196
197 AbstractNoSQL.prototype.batchSync = function(operations, options) {
198 var e, err, result, _i, _len;
199 if (this._batchSync) {
200 if (options == null) {
201 options = {};
202 }
203 if (!isArray(operations)) {
204 throw new InvalidArgumentError("batch(operations) requires an array argument");
205 }
206 for (_i = 0, _len = operations.length; _i < _len; _i++) {
207 e = operations[_i];
208 if (typeof e !== "object") {
209 continue;
210 }
211 if (err = this._checkKey(e.type, "type")) {
212 throw err;
213 }
214 if (err = this._checkKey(e.key, "key")) {
215 throw err;
216 }
217 }
218 result = this._batchSync(operations, options);
219 return result;
220 }
221 throw new NotImplementedError();
222 };
223
224 AbstractNoSQL.prototype.approximateSizeSync = function(start, end) {
225 var result;
226 if (this._approximateSizeSync) {
227 if ((start == null) || (end == null)) {
228 throw new InvalidArgumentError("approximateSize() requires valid `start`, `end` arguments");
229 }
230 if (!this._isBuffer(start)) {
231 start = String(start);
232 }
233 if (!this._isBuffer(end)) {
234 end = String(end);
235 }
236 result = this._approximateSizeSync(start, end);
237 return result;
238 }
239 throw new NotImplementedError();
240 };
241
242 AbstractNoSQL.prototype.openSync = function(options) {
243 var result;
244 if (this._openSync) {
245 if (options == null) {
246 options = this._options || {};
247 }
248 options.createIfMissing = options.createIfMissing !== false;
249 options.errorIfExists = !!options.errorIfExists;
250 this.emit("opening", options);
251 result = this._openSync(options);
252 if (result) {
253 this.setOpened(true, options);
254 }
255 if (result) {
256 result = this;
257 }
258 return result;
259 }
260 throw new NotImplementedError();
261 };
262
263 AbstractNoSQL.prototype.closeSync = function() {
264 var result;
265 if (this._closeSync) {
266 this.emit("closing");
267 result = this._closeSync();
268 if (result) {
269 this.setOpened(false);
270 }
271 return result;
272 }
273 throw new NotImplementedError();
274 };
275
276 AbstractNoSQL.prototype._open = function(options, callback) {
277 var that;
278 that = this;
279 if (this._openSync) {
280 return setImmediate(function() {
281 var err, result;
282 result = void 0;
283 try {
284 result = that._openSync(options);
285 } catch (_error) {
286 err = _error;
287 callback(err);
288 return;
289 }
290 if (result) {
291 return callback(null, result);
292 } else {
293 return callback(new OpenError("can not open database."));
294 }
295 });
296 } else {
297 return setImmediate(callback);
298 }
299 };
300
301 AbstractNoSQL.prototype._close = function(callback) {
302 var that;
303 that = this;
304 if (this._closeSync) {
305 return setImmediate(function() {
306 var err, result;
307 result = void 0;
308 try {
309 result = that._closeSync();
310 } catch (_error) {
311 err = _error;
312 callback(err);
313 return;
314 }
315 if (result) {
316 return callback(null, result);
317 } else {
318 return callback(new CloseError("can not close database."));
319 }
320 });
321 } else {
322 return setImmediate(callback);
323 }
324 };
325
326 AbstractNoSQL.prototype._isExists = function(key, options, callback) {
327 var that;
328 that = this;
329 if (this._isExistsSync) {
330 return setImmediate(function() {
331 var err, result;
332 result = void 0;
333 try {
334 result = that._isExistsSync(key, options);
335 } catch (_error) {
336 err = _error;
337 callback(err);
338 return;
339 }
340 return callback(null, result);
341 });
342 } else {
343 return this._get(key, options, function(err, value) {
344 if (err) {
345 if (AbstractError.isNotFound(err)) {
346 return callback(null, false);
347 } else {
348 return callback(err);
349 }
350 } else {
351 return callback(null, true);
352 }
353 });
354 }
355 };
356
357 AbstractNoSQL.prototype._getBuffer = function(key, destBuffer, options, callback) {
358 var that;
359 that = this;
360 if (this._getSync || this._getBufferSync !== AbstractNoSQL.prototype._getBufferSync) {
361 return setImmediate(function() {
362 var err, result;
363 result = void 0;
364 try {
365 result = that._getBufferSync(key, destBuffer, options);
366 } catch (_error) {
367 err = _error;
368 callback(err);
369 return;
370 }
371 return callback(null, result);
372 });
373 } else if (this._get) {
374 return this._get(key, options, function(err, value) {
375 var result;
376 if (err) {
377 return callback(err);
378 }
379 result = utf8ByteLength(value);
380 if (destBuffer) {
381 result = Math.min(result, destBuffer.length);
382 if (result) {
383 result = destBuffer.write(value, options.offset, result);
384 }
385 }
386 return callback(null, result);
387 });
388 } else {
389 return setImmediate(callback);
390 }
391 };
392
393 AbstractNoSQL.prototype._getBufferSync = function(key, destBuffer, options) {
394 var result, value;
395 if (this._getSync) {
396 value = this._getSync(key, options);
397 result = utf8ByteLength(value);
398 if (destBuffer) {
399 result = Math.min(result, destBuffer.length);
400 if (result) {
401 result = destBuffer.write(value, options.offset, result);
402 }
403 }
404 return result;
405 } else {
406 throw new NotImplementedError('_mGetSync: _getSync is not implemented.');
407 }
408 };
409
410 AbstractNoSQL.prototype._mGetSync = function(keys, options) {
411 var err, key, needKeyName, raiseError, result, value, _i, _len;
412 if (this._getSync) {
413 result = [];
414 needKeyName = options.keys;
415 raiseError = options.raiseError;
416 options.asBuffer = options.asBuffer === true;
417 for (_i = 0, _len = keys.length; _i < _len; _i++) {
418 key = keys[_i];
419 try {
420 value = this._getSync(key, options);
421 } catch (_error) {
422 err = _error;
423 if (raiseError) {
424 throw err;
425 }
426 value = void 0;
427 }
428 if (needKeyName !== false) {
429 result.push(key, value);
430 } else {
431 result.push(value);
432 }
433 }
434 return result;
435 } else {
436 throw new NotImplementedError('_mGetSync: _getSync is not implemented.');
437 }
438 };
439
440 AbstractNoSQL.prototype._mGet = function(keys, options, callback) {
441 var i, needKeyName, raiseError, readNext, result, that;
442 that = this;
443 if (this._getSync || this._mGetSync !== AbstractNoSQL.prototype._mGetSync) {
444 return setImmediate(function() {
445 var err, result;
446 result = void 0;
447 try {
448 result = that._mGetSync(keys, options);
449 } catch (_error) {
450 err = _error;
451 callback(err);
452 return;
453 }
454 return callback(null, result);
455 });
456 } else if (keys.length > 0 && this._get) {
457 result = [];
458 i = 0;
459 needKeyName = options.keys;
460 raiseError = options.raiseError;
461 readNext = function(err, value) {
462 if (err && raiseError) {
463 return callback(err);
464 }
465 if (needKeyName !== false) {
466 result.push(keys[i], value);
467 } else {
468 result.push(value);
469 }
470 i++;
471 if (i >= keys.length) {
472 return callback(null, result);
473 }
474 return that._get(keys[i], options, readNext);
475 };
476 return this._get(keys[i], options, readNext);
477 } else {
478 return setImmediate(callback);
479 }
480 };
481
482 AbstractNoSQL.prototype._get = function(key, options, callback) {
483 var that;
484 that = this;
485 if (this._getSync) {
486 return setImmediate(function() {
487 var err, result;
488 result = void 0;
489 try {
490 result = that._getSync(key, options);
491 } catch (_error) {
492 err = _error;
493 callback(err);
494 return;
495 }
496 return callback(null, result);
497 });
498 } else {
499 return setImmediate(callback);
500 }
501 };
502
503 AbstractNoSQL.prototype._put = function(key, value, options, callback) {
504 var that;
505 that = this;
506 if (this._putSync) {
507 return setImmediate(function() {
508 var err, result;
509 result = void 0;
510 try {
511 result = that._putSync(key, value, options);
512 } catch (_error) {
513 err = _error;
514 callback(err);
515 return;
516 }
517 return callback(null, result);
518 });
519 } else {
520 return setImmediate(callback);
521 }
522 };
523
524 AbstractNoSQL.prototype._del = function(key, options, callback) {
525 var that;
526 that = this;
527 if (this._delSync) {
528 return setImmediate(function() {
529 var err, result;
530 result = void 0;
531 try {
532 result = that._delSync(key, options);
533 } catch (_error) {
534 err = _error;
535 callback(err);
536 return;
537 }
538 return callback(null, result);
539 });
540 } else {
541 return setImmediate(callback);
542 }
543 };
544
545 AbstractNoSQL.prototype._batch = function(array, options, callback) {
546 var that;
547 that = this;
548 if (this._batchSync) {
549 return setImmediate(function() {
550 var err, result;
551 result = void 0;
552 try {
553 result = that._batchSync(array, options);
554 } catch (_error) {
555 err = _error;
556 callback(err);
557 return;
558 }
559 return callback(null, result);
560 });
561 } else {
562 return setImmediate(callback);
563 }
564 };
565
566 AbstractNoSQL.prototype._approximateSize = function(start, end, callback) {
567 var that;
568 that = this;
569 if (this._approximateSizeSync) {
570 return setImmediate(function() {
571 var err, result;
572 result = void 0;
573 try {
574 result = that._approximateSizeSync(start, end);
575 } catch (_error) {
576 err = _error;
577 callback(err);
578 return;
579 }
580 return callback(null, result);
581 });
582 } else {
583 return setImmediate(callback);
584 }
585 };
586
587 AbstractNoSQL.prototype.openAsync = function(options, callback) {
588 var that;
589 if (options == null) {
590 options = {};
591 }
592 options.createIfMissing = options.createIfMissing !== false;
593 options.errorIfExists = !!options.errorIfExists;
594 that = this;
595 this.emit("opening", options);
596 return this._open(options, function(err, result) {
597 if (err == null) {
598 that.setOpened(true, options);
599 }
600 return callback(err, result);
601 });
602 };
603
604 AbstractNoSQL.prototype.open = function(options, callback) {
605 if (isFunction(options)) {
606 callback = options;
607 options = void 0;
608 }
609 if (callback) {
610 return this.openAsync(options, callback);
611 } else {
612 return this.openSync(options);
613 }
614 };
615
616 AbstractNoSQL.prototype.closeAsync = function(callback) {
617 var that;
618 that = this;
619 if (!isFunction(callback)) {
620 callback = void 0;
621 }
622 this.emit("closing");
623 return this._close(function(err, result) {
624 if (err) {
625 return that.dispatchError(err, callback);
626 }
627 that.setOpened(false);
628 if (callback) {
629 return callback(null, result);
630 }
631 });
632 };
633
634 AbstractNoSQL.prototype.close = function(callback) {
635 if (callback) {
636 return this.closeAsync(callback);
637 } else {
638 return this.closeSync();
639 }
640 };
641
642 AbstractNoSQL.prototype.isExistsAsync = function(key, options, callback) {
643 if (options == null) {
644 options = {};
645 }
646 if (!this._isBuffer(key)) {
647 key = String(key);
648 }
649 return this._isExists(key, options, callback);
650 };
651
652 AbstractNoSQL.prototype.isExists = function(key, options, callback) {
653 if (isFunction(options)) {
654 callback = options;
655 options = {};
656 } else {
657
658 }
659 if (callback) {
660 return this.isExistsAsync(key, options, callback);
661 } else {
662 return this.isExistsSync(key, options);
663 }
664 };
665
666 AbstractNoSQL.prototype.isExist = AbstractNoSQL.prototype.isExists;
667
668 AbstractNoSQL.prototype.getBufferAsync = function(key, destBuffer, options, callback) {
669 if (options == null) {
670 options = {};
671 }
672 if (options.offset == null) {
673 options.offset = 0;
674 }
675 return this._getBuffer(key, destBuffer, options, callback);
676 };
677
678 AbstractNoSQL.prototype.getBuffer = function(key, destBuffer, options, callback) {
679 var err;
680 err = void 0;
681 if (isFunction(options)) {
682 callback = options;
683 options = {};
684 }
685 if (callback) {
686 return this.getBufferAsync(key, destBuffer, options, callback);
687 } else {
688 return this.getBufferSync(key, destBuffer, options);
689 }
690 };
691
692 AbstractNoSQL.prototype.mGetAsync = function(keys, options, callback) {
693 var needKeyName;
694 if (options == null) {
695 options = {};
696 }
697 options.asBuffer = options.asBuffer === true;
698 options.raiseError = options.raiseError !== false;
699 needKeyName = options.keys !== false;
700 return this._mGet(keys, options, function(err, arr) {
701 var i, result;
702 if (err) {
703 return callback(err);
704 }
705 if (needKeyName) {
706 i = 0;
707 result = [];
708 while (i < arr.length) {
709 result.push({
710 key: arr[i],
711 value: arr[++i]
712 });
713 i++;
714 }
715 } else {
716 result = arr;
717 }
718 return callback(null, result);
719 });
720 };
721
722 AbstractNoSQL.prototype.mGet = function(keys, options, callback) {
723 var err;
724 err = void 0;
725 if (isFunction(options)) {
726 callback = options;
727 options = {};
728 } else {
729
730 }
731 if (callback) {
732 return this.mGetAsync(keys, options, callback);
733 } else {
734 return this.mGetSync(keys, options);
735 }
736 };
737
738 AbstractNoSQL.prototype.getAsync = function(key, options, callback) {
739 var err;
740 if (options == null) {
741 options = {};
742 }
743 if (err = this._checkKey(key, "key")) {
744 return callback(err);
745 }
746 if (!this._isBuffer(key)) {
747 key = String(key);
748 }
749 options.asBuffer = options.asBuffer === true;
750 return this._get(key, options, callback);
751 };
752
753 AbstractNoSQL.prototype.get = function(key, options, callback) {
754 var err;
755 err = void 0;
756 if (isFunction(options)) {
757 callback = options;
758 options = {};
759 }
760 if (callback) {
761 return this.getAsync(key, options, callback);
762 } else {
763 return this.getSync(key, options);
764 }
765 };
766
767 AbstractNoSQL.prototype.putAsync = function(key, value, options, callback) {
768 var err;
769 if (options == null) {
770 options = {};
771 }
772 if (err = this._checkKey(key, "key", this._isBuffer)) {
773 return callback(err);
774 }
775 if (!this._isBuffer(key)) {
776 key = String(key);
777 }
778 if ((value != null) && !this._isBuffer(value) && !process.browser) {
779 value = String(value);
780 }
781 return this._put(key, value, options, callback);
782 };
783
784 AbstractNoSQL.prototype.put = function(key, value, options, callback) {
785 var err;
786 err = void 0;
787 if (isFunction(options)) {
788 callback = options;
789 options = {};
790 }
791 if (callback) {
792 return this.putAsync(key, value, options, callback);
793 } else {
794 return this.putSync(key, value, options);
795 }
796 };
797
798 AbstractNoSQL.prototype.delAsync = function(key, options, callback) {
799 var err;
800 if (options == null) {
801 options = {};
802 }
803 if (err = this._checkKey(key, "key", this._isBuffer)) {
804 return callback(err);
805 }
806 if (!this._isBuffer(key)) {
807 key = String(key);
808 }
809 return this._del(key, options, callback);
810 };
811
812 AbstractNoSQL.prototype.del = function(key, options, callback) {
813 var err;
814 err = void 0;
815 if (isFunction(options)) {
816 callback = options;
817 options = {};
818 }
819 if (callback) {
820 return this.delAsync(key, options, callback);
821 } else {
822 return this.delSync(key, options);
823 }
824 };
825
826 AbstractNoSQL.prototype.batchAsync = function(array, options, callback) {
827 var e, err, vError, _i, _len;
828 if (options == null) {
829 options = {};
830 }
831 if (!isArray(array)) {
832 vError = new InvalidArgumentError("batch(array) requires an array argument");
833 return callback(vError);
834 }
835 for (_i = 0, _len = array.length; _i < _len; _i++) {
836 e = array[_i];
837 if (typeof e !== "object") {
838 continue;
839 }
840 if (err = this._checkKey(e.type, "type")) {
841 return callback(err);
842 }
843 if (err = this._checkKey(e.key, "key")) {
844 return callback(err);
845 }
846 }
847 return this._batch(array, options, callback);
848 };
849
850 AbstractNoSQL.prototype.batch = function(array, options, callback) {
851 if (!arguments.length) {
852 return this._chainedBatch();
853 }
854 if (isFunction(options)) {
855 callback = options;
856 options = {};
857 }
858 if (isFunction(array)) {
859 callback = array;
860 }
861 if (callback) {
862 return this.batchAsync(array, options, callback);
863 } else {
864 return this.batchSync(array, options);
865 }
866 };
867
868 AbstractNoSQL.prototype.approximateSizeAsync = function(start, end, callback) {
869 if (!this._isBuffer(start)) {
870 start = String(start);
871 }
872 if (!this._isBuffer(end)) {
873 end = String(end);
874 }
875 return this._approximateSize(start, end, callback);
876 };
877
878 AbstractNoSQL.prototype.approximateSize = function(start, end, callback) {
879 if ((start == null) || (end == null) || isFunction(start) || isFunction(end)) {
880 throw new InvalidArgumentError("approximateSize() requires valid `start`, `end` and `callback`(for async) arguments");
881 }
882 if (callback) {
883 return this.approximateSizeAsync(start, end, callback);
884 } else {
885 return this.approximateSizeSync(start, end);
886 }
887 };
888
889 AbstractNoSQL.prototype.IteratorClass = AbstractIterator;
890
891 AbstractNoSQL.prototype.iterator = function(options) {
892 if (typeof options !== "object") {
893 options = {};
894 }
895 if (this.IteratorClass) {
896 return new this.IteratorClass(this, options);
897 } else if (isFunction(this._iterator)) {
898 console.error("_iterator is deprecated. please use the IteratorClass instead.");
899 return this._iterator(options);
900 }
901 throw new NotImplementedError();
902 };
903
904 AbstractNoSQL.prototype._chainedBatch = function() {
905 return new AbstractChainedBatch(this);
906 };
907
908 AbstractNoSQL.prototype._isBuffer = function(obj) {
909 return Buffer.isBuffer(obj);
910 };
911
912 AbstractNoSQL.prototype._checkKey = function(obj, type) {
913 if (obj == null) {
914 return new InvalidArgumentError(type + " cannot be `null` or `undefined`");
915 }
916 if (this._isBuffer(obj)) {
917 if (obj.length === 0) {
918 return new InvalidArgumentError(type + " cannot be an empty Buffer");
919 }
920 } else {
921 if (String(obj) === "") {
922 return new InvalidArgumentError(type + " cannot be an empty String");
923 }
924 }
925 };
926
927 AbstractNoSQL.prototype.isOpen = function() {
928 return !!this._opened;
929 };
930
931 return AbstractNoSQL;
932
933 })();
934
935 module.exports.AbstractNoSQL = AbstractNoSQL;
936
937 module.exports.__defineGetter__("AbstractLevelDOWN", function() {
938 console.error("AbstractLevelDOWN is deprecated. use AbstractNoSQL instead.");
939 return AbstractNoSQL;
940 });
941
942 module.exports.__defineGetter__("AbstractIterator", function() {
943 console.error("AbstractIterator is deprecated. it's moved to abstract-iterator.");
944 if (!AbstractIterator) {
945 console.error("first `npm install abstract-iterator`");
946 }
947 return AbstractIterator;
948 });
949
950 module.exports.AbstractChainedBatch = AbstractChainedBatch;
951
952}).call(this);