asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject [8/8] incubator-asterixdb git commit: ASTERIXDB-1220: print nested values using visitors
Date Thu, 26 May 2016 19:19:18 GMT
ASTERIXDB-1220: print nested values using visitors

- remove named printer classes
- remove redundancy between AObjectPrinterFactory and PrintVisitor
- remove redundant List- and RecordPrinters
- introduce AbstractPrintVisitor

Change-Id: I692c04dd1b3aa8e7adccfe960615f0fc2df6fe26
Reviewed-on: https://asterix-gerrit.ics.uci.edu/882
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/fd7fb5a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/fd7fb5a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/fd7fb5a1

Branch: refs/heads/master
Commit: fd7fb5a1002a8ad787d50610893e1bf0e6421ac7
Parents: bd1d98c
Author: Till Westmann <tillw@apache.org>
Authored: Thu May 26 11:18:01 2016 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Thu May 26 12:18:54 2016 -0700

----------------------------------------------------------------------
 .../data/nontagged/printers/PrintTools.java     |  33 ++++
 .../printers/adm/ABinaryBase64Printer.java      |  53 -----
 .../printers/adm/ABinaryHexPrinter.java         |  53 -----
 .../printers/adm/ABinaryHexPrinterFactory.java  |  55 ++++++
 .../printers/adm/ABinaryPrinterFactory.java     |  37 ----
 .../nontagged/printers/adm/ABooleanPrinter.java |  39 ----
 .../printers/adm/ABooleanPrinterFactory.java    |   9 +-
 .../nontagged/printers/adm/ACirclePrinter.java  |  45 -----
 .../printers/adm/ACirclePrinterFactory.java     |  16 +-
 .../nontagged/printers/adm/ADatePrinter.java    |  41 ----
 .../printers/adm/ADatePrinterFactory.java       |  12 +-
 .../printers/adm/ADateTimePrinter.java          |  41 ----
 .../printers/adm/ADateTimePrinterFactory.java   |  12 +-
 .../printers/adm/ADayTimeDurationPrinter.java   |  41 ----
 .../adm/ADayTimeDurationPrinterFactory.java     |  12 +-
 .../nontagged/printers/adm/ADoublePrinter.java  |  39 ----
 .../printers/adm/ADoublePrinterFactory.java     |   9 +-
 .../printers/adm/ADurationPrinter.java          |  41 ----
 .../printers/adm/ADurationPrinterFactory.java   |  12 +-
 .../nontagged/printers/adm/AFloatPrinter.java   |  39 ----
 .../printers/adm/AFloatPrinterFactory.java      |   9 +-
 .../nontagged/printers/adm/AInt16Printer.java   |  49 -----
 .../printers/adm/AInt16PrinterFactory.java      |  19 +-
 .../nontagged/printers/adm/AInt32Printer.java   |  49 -----
 .../printers/adm/AInt32PrinterFactory.java      |  19 +-
 .../nontagged/printers/adm/AInt64Printer.java   |  46 -----
 .../printers/adm/AInt64PrinterFactory.java      |  17 +-
 .../nontagged/printers/adm/AInt8Printer.java    |  49 -----
 .../printers/adm/AInt8PrinterFactory.java       |  19 +-
 .../printers/adm/AIntervalPrinter.java          |  75 -------
 .../printers/adm/AIntervalPrinterFactory.java   |  35 +++-
 .../nontagged/printers/adm/ALinePrinter.java    |  47 -----
 .../printers/adm/ALinePrinterFactory.java       |  18 +-
 .../nontagged/printers/adm/ANullPrinter.java    |  38 ----
 .../printers/adm/ANullPrinterFactory.java       |   7 +-
 .../adm/ANullableFieldPrinterFactory.java       |   2 -
 .../nontagged/printers/adm/AObjectPrinter.java  | 176 -----------------
 .../printers/adm/AObjectPrinterFactory.java     | 135 ++++++++++++-
 .../adm/AOrderedlistPrinterFactory.java         |  12 +-
 .../nontagged/printers/adm/APoint3DPrinter.java |  45 -----
 .../printers/adm/APoint3DPrinterFactory.java    |  16 +-
 .../nontagged/printers/adm/APointPrinter.java   |  43 ----
 .../printers/adm/APointPrinterFactory.java      |  14 +-
 .../nontagged/printers/adm/APolygonPrinter.java |  52 -----
 .../printers/adm/APolygonPrinterFactory.java    |  23 ++-
 .../printers/adm/ARecordPrinterFactory.java     |   6 +-
 .../printers/adm/ARectanglePrinter.java         |  47 -----
 .../printers/adm/ARectanglePrinterFactory.java  |  18 +-
 .../nontagged/printers/adm/AStringPrinter.java  |  45 -----
 .../printers/adm/AStringPrinterFactory.java     |  17 +-
 .../nontagged/printers/adm/ATimePrinter.java    |  41 ----
 .../printers/adm/ATimePrinterFactory.java       |  12 +-
 .../nontagged/printers/adm/AUUIDPrinter.java    |  44 -----
 .../printers/adm/AUUIDPrinterFactory.java       |  13 +-
 .../printers/adm/AUnionPrinterFactory.java      |   4 -
 .../adm/AUnorderedlistPrinterFactory.java       |  11 +-
 .../printers/adm/AYearMonthDurationPrinter.java |  79 --------
 .../adm/AYearMonthDurationPrinterFactory.java   |  15 +-
 .../adm/ShortWithoutTypeInfoPrinter.java        |  46 -----
 .../adm/ShortWithoutTypeInfoPrinterFactory.java |   9 +-
 .../printers/csv/ABinaryHexPrinter.java         |  51 -----
 .../printers/csv/ABinaryHexPrinterFactory.java  |  53 +++++
 .../printers/csv/ABinaryPrinterFactory.java     |  38 ----
 .../nontagged/printers/csv/ABooleanPrinter.java |  39 ----
 .../printers/csv/ABooleanPrinterFactory.java    |   9 +-
 .../nontagged/printers/csv/ACirclePrinter.java  |  45 -----
 .../printers/csv/ACirclePrinterFactory.java     |  16 +-
 .../nontagged/printers/csv/ADatePrinter.java    |  41 ----
 .../printers/csv/ADatePrinterFactory.java       |  12 +-
 .../printers/csv/ADateTimePrinter.java          |  41 ----
 .../printers/csv/ADateTimePrinterFactory.java   |  12 +-
 .../printers/csv/ADayTimeDurationPrinter.java   |  41 ----
 .../csv/ADayTimeDurationPrinterFactory.java     |  12 +-
 .../nontagged/printers/csv/ADoublePrinter.java  |  39 ----
 .../printers/csv/ADoublePrinterFactory.java     |   9 +-
 .../printers/csv/ADurationPrinter.java          |  41 ----
 .../printers/csv/ADurationPrinterFactory.java   |  12 +-
 .../nontagged/printers/csv/AFloatPrinter.java   |  39 ----
 .../printers/csv/AFloatPrinterFactory.java      |   9 +-
 .../nontagged/printers/csv/AInt16Printer.java   |  39 ----
 .../printers/csv/AInt16PrinterFactory.java      |   9 +-
 .../nontagged/printers/csv/AInt32Printer.java   |  40 ----
 .../printers/csv/AInt32PrinterFactory.java      |   9 +-
 .../nontagged/printers/csv/AInt64Printer.java   |  39 ----
 .../printers/csv/AInt64PrinterFactory.java      |   9 +-
 .../nontagged/printers/csv/AInt8Printer.java    |  40 ----
 .../printers/csv/AInt8PrinterFactory.java       |   9 +-
 .../printers/csv/AIntervalPrinter.java          |  39 ----
 .../printers/csv/AIntervalPrinterFactory.java   |  10 +-
 .../nontagged/printers/csv/ALinePrinter.java    |  47 -----
 .../printers/csv/ALinePrinterFactory.java       |  18 +-
 .../nontagged/printers/csv/ANullPrinter.java    |  38 ----
 .../printers/csv/ANullPrinterFactory.java       |   7 +-
 .../csv/ANullableFieldPrinterFactory.java       |   1 -
 .../nontagged/printers/csv/AObjectPrinter.java  | 154 ---------------
 .../printers/csv/AObjectPrinterFactory.java     | 119 +++++++++++-
 .../nontagged/printers/csv/APoint3DPrinter.java |  45 -----
 .../printers/csv/APoint3DPrinterFactory.java    |  16 +-
 .../nontagged/printers/csv/APointPrinter.java   |  43 ----
 .../printers/csv/APointPrinterFactory.java      |  14 +-
 .../nontagged/printers/csv/APolygonPrinter.java |  58 ------
 .../printers/csv/APolygonPrinterFactory.java    |  25 ++-
 .../printers/csv/ARecordPrinterFactory.java     |   6 +-
 .../printers/csv/ARectanglePrinter.java         |  47 -----
 .../printers/csv/ARectanglePrinterFactory.java  |  18 +-
 .../nontagged/printers/csv/AStringPrinter.java  |  44 -----
 .../printers/csv/AStringPrinterFactory.java     |  16 +-
 .../nontagged/printers/csv/ATimePrinter.java    |  41 ----
 .../printers/csv/ATimePrinterFactory.java       |  12 +-
 .../nontagged/printers/csv/AUUIDPrinter.java    |  44 -----
 .../printers/csv/AUUIDPrinterFactory.java       |  13 +-
 .../printers/csv/AUnionPrinterFactory.java      |   2 -
 .../printers/csv/AYearMonthDurationPrinter.java |  45 -----
 .../csv/AYearMonthDurationPrinterFactory.java   |  15 +-
 .../printers/json/clean/ABinaryHexPrinter.java  |  54 ------
 .../json/clean/ABinaryHexPrinterFactory.java    |  55 ++++++
 .../json/clean/ABinaryPrinterFactory.java       |  37 ----
 .../printers/json/clean/ABooleanPrinter.java    |  39 ----
 .../json/clean/ABooleanPrinterFactory.java      |   9 +-
 .../printers/json/clean/ACirclePrinter.java     |  45 -----
 .../json/clean/ACirclePrinterFactory.java       |  16 +-
 .../printers/json/clean/ADatePrinter.java       |  41 ----
 .../json/clean/ADatePrinterFactory.java         |  12 +-
 .../printers/json/clean/ADateTimePrinter.java   |  41 ----
 .../json/clean/ADateTimePrinterFactory.java     |  12 +-
 .../json/clean/ADayTimeDurationPrinter.java     |  41 ----
 .../clean/ADayTimeDurationPrinterFactory.java   |  12 +-
 .../printers/json/clean/ADoublePrinter.java     |  39 ----
 .../json/clean/ADoublePrinterFactory.java       |   9 +-
 .../printers/json/clean/ADurationPrinter.java   |  41 ----
 .../json/clean/ADurationPrinterFactory.java     |  12 +-
 .../printers/json/clean/AFloatPrinter.java      |  39 ----
 .../json/clean/AFloatPrinterFactory.java        |   9 +-
 .../printers/json/clean/AInt16Printer.java      |  39 ----
 .../json/clean/AInt16PrinterFactory.java        |   9 +-
 .../printers/json/clean/AInt32Printer.java      |  40 ----
 .../json/clean/AInt32PrinterFactory.java        |   9 +-
 .../printers/json/clean/AInt64Printer.java      |  39 ----
 .../json/clean/AInt64PrinterFactory.java        |   9 +-
 .../printers/json/clean/AInt8Printer.java       |  40 ----
 .../json/clean/AInt8PrinterFactory.java         |   9 +-
 .../printers/json/clean/AIntervalPrinter.java   |  78 --------
 .../json/clean/AIntervalPrinterFactory.java     |  35 +++-
 .../printers/json/clean/ALinePrinter.java       |  47 -----
 .../json/clean/ALinePrinterFactory.java         |  18 +-
 .../printers/json/clean/ANullPrinter.java       |  38 ----
 .../json/clean/ANullPrinterFactory.java         |   7 +-
 .../clean/ANullableFieldPrinterFactory.java     |   3 -
 .../printers/json/clean/AObjectPrinter.java     | 172 ----------------
 .../json/clean/AObjectPrinterFactory.java       | 132 ++++++++++++-
 .../json/clean/AOrderedlistPrinterFactory.java  |  12 +-
 .../printers/json/clean/APoint3DPrinter.java    |  45 -----
 .../json/clean/APoint3DPrinterFactory.java      |  16 +-
 .../printers/json/clean/APointPrinter.java      |  43 ----
 .../json/clean/APointPrinterFactory.java        |  14 +-
 .../printers/json/clean/APolygonPrinter.java    |  58 ------
 .../json/clean/APolygonPrinterFactory.java      |  25 ++-
 .../json/clean/ARecordPrinterFactory.java       |   6 +-
 .../printers/json/clean/ARectanglePrinter.java  |  47 -----
 .../json/clean/ARectanglePrinterFactory.java    |  18 +-
 .../printers/json/clean/AStringPrinter.java     |  44 -----
 .../json/clean/AStringPrinterFactory.java       |  16 +-
 .../printers/json/clean/ATimePrinter.java       |  42 ----
 .../json/clean/ATimePrinterFactory.java         |  12 +-
 .../printers/json/clean/AUUIDPrinter.java       |  44 -----
 .../json/clean/AUUIDPrinterFactory.java         |  13 +-
 .../json/clean/AUnionPrinterFactory.java        |   4 -
 .../clean/AUnorderedlistPrinterFactory.java     |   6 +-
 .../json/clean/AYearMonthDurationPrinter.java   |  51 -----
 .../clean/AYearMonthDurationPrinterFactory.java |  15 +-
 .../json/lossless/ABinaryHexPrinter.java        |  52 -----
 .../json/lossless/ABinaryHexPrinterFactory.java |  52 +++++
 .../json/lossless/ABinaryPrinterFactory.java    |  37 ----
 .../printers/json/lossless/ABooleanPrinter.java |  39 ----
 .../json/lossless/ABooleanPrinterFactory.java   |   9 +-
 .../printers/json/lossless/ACirclePrinter.java  |  45 -----
 .../json/lossless/ACirclePrinterFactory.java    |  16 +-
 .../printers/json/lossless/ADatePrinter.java    |  41 ----
 .../json/lossless/ADatePrinterFactory.java      |  12 +-
 .../json/lossless/ADateTimePrinter.java         |  41 ----
 .../json/lossless/ADateTimePrinterFactory.java  |  12 +-
 .../json/lossless/ADayTimeDurationPrinter.java  |  42 ----
 .../ADayTimeDurationPrinterFactory.java         |  12 +-
 .../printers/json/lossless/ADoublePrinter.java  |  39 ----
 .../json/lossless/ADoublePrinterFactory.java    |   9 +-
 .../json/lossless/ADurationPrinter.java         |  41 ----
 .../json/lossless/ADurationPrinterFactory.java  |  12 +-
 .../printers/json/lossless/AFloatPrinter.java   |  39 ----
 .../json/lossless/AFloatPrinterFactory.java     |   9 +-
 .../printers/json/lossless/AInt16Printer.java   |  42 ----
 .../json/lossless/AInt16PrinterFactory.java     |  12 +-
 .../printers/json/lossless/AInt32Printer.java   |  43 ----
 .../json/lossless/AInt32PrinterFactory.java     |  12 +-
 .../printers/json/lossless/AInt64Printer.java   |  41 ----
 .../json/lossless/AInt64PrinterFactory.java     |  12 +-
 .../printers/json/lossless/AInt8Printer.java    |  43 ----
 .../json/lossless/AInt8PrinterFactory.java      |  12 +-
 .../json/lossless/AIntervalPrinter.java         |  78 --------
 .../json/lossless/AIntervalPrinterFactory.java  |  35 +++-
 .../printers/json/lossless/ALinePrinter.java    |  48 -----
 .../json/lossless/ALinePrinterFactory.java      |  19 +-
 .../printers/json/lossless/ANullPrinter.java    |  38 ----
 .../json/lossless/ANullPrinterFactory.java      |   7 +-
 .../lossless/ANullableFieldPrinterFactory.java  |   3 -
 .../printers/json/lossless/AObjectPrinter.java  | 172 ----------------
 .../json/lossless/AObjectPrinterFactory.java    | 132 ++++++++++++-
 .../lossless/AOrderedlistPrinterFactory.java    |  10 +-
 .../printers/json/lossless/APoint3DPrinter.java |  45 -----
 .../json/lossless/APoint3DPrinterFactory.java   |  16 +-
 .../printers/json/lossless/APointPrinter.java   |  43 ----
 .../json/lossless/APointPrinterFactory.java     |  14 +-
 .../printers/json/lossless/APolygonPrinter.java |  59 ------
 .../json/lossless/APolygonPrinterFactory.java   |  25 ++-
 .../json/lossless/ARecordPrinterFactory.java    |   6 +-
 .../json/lossless/ARectanglePrinter.java        |  48 -----
 .../json/lossless/ARectanglePrinterFactory.java |  19 +-
 .../printers/json/lossless/AStringPrinter.java  |  44 -----
 .../json/lossless/AStringPrinterFactory.java    |  16 +-
 .../printers/json/lossless/ATimePrinter.java    |  41 ----
 .../json/lossless/ATimePrinterFactory.java      |  12 +-
 .../printers/json/lossless/AUUIDPrinter.java    |  43 ----
 .../json/lossless/AUUIDPrinterFactory.java      |  14 +-
 .../json/lossless/AUnionPrinterFactory.java     |   3 -
 .../lossless/AUnorderedlistPrinterFactory.java  |   6 +-
 .../lossless/AYearMonthDurationPrinter.java     |  51 -----
 .../AYearMonthDurationPrinterFactory.java       |  15 +-
 .../nontagged/AqlADMPrinterFactoryProvider.java |   4 +-
 .../AqlCleanJSONPrinterFactoryProvider.java     |   4 +-
 .../AqlLosslessJSONPrinterFactoryProvider.java  |   4 +-
 .../org/apache/asterix/om/base/ABoolean.java    |  28 ++-
 .../om/pointables/printer/AListPrinter.java     |  81 ++++++++
 .../om/pointables/printer/ARecordPrinter.java   |  95 +++++++++
 .../printer/AbstractPrintVisitor.java           |  93 +++++++++
 .../om/pointables/printer/IPrintVisitor.java    |  28 +++
 .../om/pointables/printer/adm/AListPrinter.java |  89 ---------
 .../pointables/printer/adm/APrintVisitor.java   | 193 ++----------------
 .../pointables/printer/adm/ARecordPrinter.java  |  92 ---------
 .../pointables/printer/csv/APrintVisitor.java   | 182 ++---------------
 .../pointables/printer/csv/ARecordPrinter.java  |  81 --------
 .../printer/json/clean/AListPrinter.java        |  81 --------
 .../printer/json/clean/APrintVisitor.java       | 193 ++----------------
 .../printer/json/clean/ARecordPrinter.java      |  92 ---------
 .../printer/json/lossless/AListPrinter.java     |  86 --------
 .../printer/json/lossless/APrintVisitor.java    | 194 ++-----------------
 .../printer/json/lossless/ARecordPrinter.java   |  92 ---------
 .../nontagged/printers/ABinaryPrinterTest.java  |   4 +-
 .../hyracks/algebricks/data/IPrinter.java       |   4 +-
 247 files changed, 2262 insertions(+), 6864 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
index 7dfb84d..5b5f53f 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
@@ -108,6 +108,39 @@ public class PrintTools {
         }
     }
 
+    public static void printYearMonthDurationString(byte[] b, int s, int l, PrintStream ps)
+            throws HyracksDataException {
+        final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
+        boolean positive = true;
+        int months = AInt32SerializerDeserializer.getInt(b, s + 1);
+
+        // set the negative flag. "||" is necessary in case that months field is not there (so it is 0)
+        if (months < 0) {
+            months *= -1;
+            positive = false;
+        }
+
+        int month = gCalInstance.getDurationMonth(months);
+        int year = gCalInstance.getDurationYear(months);
+
+        if (!positive) {
+            ps.print("-");
+        }
+        try {
+            ps.print("P");
+            if (year != 0) {
+                WriteValueTools.writeInt(year, ps);
+                ps.print("Y");
+            }
+            if (month != 0) {
+                WriteValueTools.writeInt(month, ps);
+                ps.print("M");
+            }
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    }
+
     public static void printDurationString(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
         boolean positive = true;
         int months = AInt32SerializerDeserializer.getInt(b, s + 1);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryBase64Printer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryBase64Printer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryBase64Printer.java
deleted file mode 100644
index 0d02394..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryBase64Printer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.data.std.primitive.ByteArrayPointable;
-import org.apache.hyracks.util.bytes.Base64Printer;
-
-public class ABinaryBase64Printer implements IPrinter {
-    private ABinaryBase64Printer() {
-    }
-
-    public static final ABinaryBase64Printer INSTANCE = new ABinaryBase64Printer();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        int validLength = ByteArrayPointable.getContentLength(b, s + 1);
-        int start = s + 1 + ByteArrayPointable.getNumberBytesToStoreMeta(validLength);
-        try {
-            ps.print("base64(\"");
-            Base64Printer.printBase64Binary(b, start, validLength, ps);
-            ps.print("\")");
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java
deleted file mode 100644
index 5e353c1..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.hyracks.data.std.primitive.ByteArrayPointable;
-import org.apache.hyracks.util.bytes.HexPrinter;
-
-public class ABinaryHexPrinter implements IPrinter {
-    private ABinaryHexPrinter() {
-    }
-
-    public static final ABinaryHexPrinter INSTANCE = new ABinaryHexPrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        int validLength = ByteArrayPointable.getContentLength(b, s + 1);
-        int start = s + 1 + ByteArrayPointable.getNumberBytesToStoreMeta(validLength);
-        try {
-            ps.print("hex(\"");
-            HexPrinter.printHexString(b, start, validLength, ps);
-            ps.print("\")");
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinterFactory.java
new file mode 100644
index 0000000..b5ac617
--- /dev/null
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinterFactory.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.asterix.dataflow.data.nontagged.printers.adm;
+
+import java.io.IOException;
+import java.io.PrintStream;
+
+import org.apache.hyracks.algebricks.data.IPrinter;
+import org.apache.hyracks.algebricks.data.IPrinterFactory;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.hyracks.data.std.primitive.ByteArrayPointable;
+import org.apache.hyracks.util.bytes.HexPrinter;
+
+public class ABinaryHexPrinterFactory implements IPrinterFactory {
+    private static final long serialVersionUID = 1L;
+
+    private ABinaryHexPrinterFactory() {
+    }
+
+    public static final ABinaryHexPrinterFactory INSTANCE = new ABinaryHexPrinterFactory();
+
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        int validLength = ByteArrayPointable.getContentLength(b, s + 1);
+        int start = s + 1 + ByteArrayPointable.getNumberBytesToStoreMeta(validLength);
+        try {
+            ps.print("hex(\"");
+            HexPrinter.printHexString(b, start, validLength, ps);
+            ps.print("\")");
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    };
+
+    @Override
+    public IPrinter createPrinter() {
+        return PRINTER;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryPrinterFactory.java
deleted file mode 100644
index 2155369..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryPrinterFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.algebricks.data.IPrinterFactory;
-
-public class ABinaryPrinterFactory implements IPrinterFactory {
-    private static final long serialVersionUID = 1L;
-
-    private ABinaryPrinterFactory() {
-    }
-
-    public static final ABinaryPrinterFactory INSTANCE = new ABinaryPrinterFactory();
-
-    @Override
-    public IPrinter createPrinter() {
-        return ABinaryHexPrinter.INSTANCE;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinter.java
deleted file mode 100644
index 09b36bc..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.ABooleanSerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ABooleanPrinter implements IPrinter {
-
-    public static final ABooleanPrinter INSTANCE = new ABooleanPrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print(ABooleanSerializerDeserializer.getBoolean(b, s + 1));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinterFactory.java
index 7f719f1..511ea9f 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABooleanPrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.ABooleanSerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,11 @@ public class ABooleanPrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ABooleanPrinterFactory INSTANCE = new ABooleanPrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> ps
+            .print(ABooleanSerializerDeserializer.getBoolean(b, s + 1));
+
     @Override
     public IPrinter createPrinter() {
-        return ABooleanPrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinter.java
deleted file mode 100644
index f2d6904..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinter.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ACirclePrinter implements IPrinter {
-
-    public static final ACirclePrinter INSTANCE = new ACirclePrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print("circle(\"");
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
-        ps.print(",");
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
-        ps.print(" ");
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
-        ps.print("\")");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinterFactory.java
index cfe9250..49cbf04 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ACirclePrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,18 @@ public class ACirclePrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ACirclePrinterFactory INSTANCE = new ACirclePrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        ps.print("circle(\"");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+        ps.print(",");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
+        ps.print(" ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
+        ps.print("\")");
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return ACirclePrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinter.java
deleted file mode 100644
index 6f4d28d..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ADatePrinter implements IPrinter {
-
-    public static final ADatePrinter INSTANCE = new ADatePrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print("date(\"");
-        PrintTools.printDateString(b, s, l, ps);
-        ps.print("\")");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinterFactory.java
index e486966..eec4607 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADatePrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,14 @@ public class ADatePrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ADatePrinterFactory INSTANCE = new ADatePrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        ps.print("date(\"");
+        PrintTools.printDateString(b, s, l, ps);
+        ps.print("\")");
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return ADatePrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinter.java
deleted file mode 100644
index 6a9b77c..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ADateTimePrinter implements IPrinter {
-
-    public static final ADateTimePrinter INSTANCE = new ADateTimePrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print("datetime(\"");
-        PrintTools.printDateTimeString(b, s, l, ps);
-        ps.print("\")");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinterFactory.java
index 966ff29..5702a43 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADateTimePrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,14 @@ public class ADateTimePrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ADateTimePrinterFactory INSTANCE = new ADateTimePrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        ps.print("datetime(\"");
+        PrintTools.printDateTimeString(b, s, l, ps);
+        ps.print("\")");
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return ADateTimePrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinter.java
deleted file mode 100644
index 36a7711..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ADayTimeDurationPrinter implements IPrinter {
-
-    public static final ADayTimeDurationPrinter INSTANCE = new ADayTimeDurationPrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print("day-time-duration(\"");
-        PrintTools.printDayTimeDurationString(b, s, l, ps);
-        ps.print("\")");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinterFactory.java
index fe26a42..360b8f0 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADayTimeDurationPrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,14 @@ public class ADayTimeDurationPrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ADayTimeDurationPrinterFactory INSTANCE = new ADayTimeDurationPrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        ps.print("day-time-duration(\"");
+        PrintTools.printDayTimeDurationString(b, s, l, ps);
+        ps.print("\")");
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return ADayTimeDurationPrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinter.java
deleted file mode 100644
index 6b54394..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ADoublePrinter implements IPrinter {
-
-    public static final ADoublePrinter INSTANCE = new ADoublePrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1) + "d");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinterFactory.java
index 8baac2e..6103f7c 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADoublePrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,11 @@ public class ADoublePrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ADoublePrinterFactory INSTANCE = new ADoublePrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> ps
+            .print(ADoubleSerializerDeserializer.getDouble(b, s + 1) + "d");
+
     @Override
     public IPrinter createPrinter() {
-        return ADoublePrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinter.java
deleted file mode 100644
index 6fb27fb..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ADurationPrinter implements IPrinter {
-
-    public static final ADurationPrinter INSTANCE = new ADurationPrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print("duration(\"");
-        PrintTools.printDurationString(b, s, l, ps);
-        ps.print("\")");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinterFactory.java
index 5b64a6e..cd7c978 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ADurationPrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,14 @@ public class ADurationPrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ADurationPrinterFactory INSTANCE = new ADurationPrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        ps.print("duration(\"");
+        PrintTools.printDurationString(b, s, l, ps);
+        ps.print("\")");
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return ADurationPrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinter.java
deleted file mode 100644
index bd15ea1..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class AFloatPrinter implements IPrinter {
-
-    public static final AFloatPrinter INSTANCE = new AFloatPrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print(AFloatSerializerDeserializer.getFloat(b, s + 1) + "f");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinterFactory.java
index bcfb9df..372a027 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AFloatPrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,11 @@ public class AFloatPrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final AFloatPrinterFactory INSTANCE = new AFloatPrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> ps
+            .print(AFloatSerializerDeserializer.getFloat(b, s + 1) + "f");
+
     @Override
     public IPrinter createPrinter() {
-        return AFloatPrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16Printer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16Printer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16Printer.java
deleted file mode 100644
index e8b86df..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16Printer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class AInt16Printer implements IPrinter {
-
-    private static final String SUFFIX_STRING = "i16";
-
-    public static final AInt16Printer INSTANCE = new AInt16Printer();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        short i = AInt16SerializerDeserializer.getShort(b, s + 1);
-        try {
-            WriteValueTools.writeInt(i, ps);
-            WriteValueTools.writeUTF8StringNoQuotes(SUFFIX_STRING, ps);
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16PrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16PrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16PrinterFactory.java
index d9094a0..2f02d93 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16PrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt16PrinterFactory.java
@@ -18,17 +18,32 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.IOException;
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
+import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public class AInt16PrinterFactory implements IPrinterFactory {
 
     private static final long serialVersionUID = 1L;
+    private static final String SUFFIX_STRING = "i16";
     public static final AInt16PrinterFactory INSTANCE = new AInt16PrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        try {
+            WriteValueTools.writeInt(AInt16SerializerDeserializer.getShort(b, s + 1), ps);
+            WriteValueTools.writeUTF8StringNoQuotes(SUFFIX_STRING, ps);
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return AInt16Printer.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32Printer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32Printer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32Printer.java
deleted file mode 100644
index 1f05cb7..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32Printer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class AInt32Printer implements IPrinter {
-
-    private static final String SUFFIX_STRING = "i32";
-
-    public static final AInt32Printer INSTANCE = new AInt32Printer();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        int d = AInt32SerializerDeserializer.getInt(b, s + 1);
-        try {
-            WriteValueTools.writeInt(d, ps);
-            WriteValueTools.writeUTF8StringNoQuotes(SUFFIX_STRING, ps);
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32PrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32PrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32PrinterFactory.java
index da7935c..3bae963 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32PrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt32PrinterFactory.java
@@ -18,17 +18,32 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.IOException;
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
+import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public class AInt32PrinterFactory implements IPrinterFactory {
 
     private static final long serialVersionUID = 1L;
+    private static final String SUFFIX_STRING = "i32";
     public static final AInt32PrinterFactory INSTANCE = new AInt32PrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        try {
+            WriteValueTools.writeInt(AInt32SerializerDeserializer.getInt(b, s + 1), ps);
+            WriteValueTools.writeUTF8StringNoQuotes(SUFFIX_STRING, ps);
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return AInt32Printer.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64Printer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64Printer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64Printer.java
deleted file mode 100644
index 2ed8224..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64Printer.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class AInt64Printer implements IPrinter {
-
-    public static final AInt64Printer INSTANCE = new AInt64Printer();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        long d = AInt64SerializerDeserializer.getLong(b, s + 1);
-        try {
-            WriteValueTools.writeLong(d, ps);
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64PrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64PrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64PrinterFactory.java
index 27a61f7..0c00cee 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64PrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt64PrinterFactory.java
@@ -18,17 +18,30 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.IOException;
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
+import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public class AInt64PrinterFactory implements IPrinterFactory {
 
     private static final long serialVersionUID = 1L;
     public static final AInt64PrinterFactory INSTANCE = new AInt64PrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        try {
+            WriteValueTools.writeLong(AInt64SerializerDeserializer.getLong(b, s + 1), ps);
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return AInt64Printer.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8Printer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8Printer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8Printer.java
deleted file mode 100644
index 979d745..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8Printer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class AInt8Printer implements IPrinter {
-
-    private static final String SUFFIX_STRING = "i8";
-
-    public static final AInt8Printer INSTANCE = new AInt8Printer();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        byte o = AInt8SerializerDeserializer.getByte(b, s + 1);
-        try {
-            WriteValueTools.writeInt(o, ps);
-            WriteValueTools.writeUTF8StringNoQuotes(SUFFIX_STRING, ps);
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8PrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8PrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8PrinterFactory.java
index 21b3c05..d1ba898 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8PrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AInt8PrinterFactory.java
@@ -18,17 +18,32 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.IOException;
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
+import org.apache.hyracks.algebricks.data.utils.WriteValueTools;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public class AInt8PrinterFactory implements IPrinterFactory {
 
     private static final long serialVersionUID = 1L;
+    private static final String SUFFIX_STRING = "i8";
     public static final AInt8PrinterFactory INSTANCE = new AInt8PrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        try {
+            WriteValueTools.writeInt(AInt8SerializerDeserializer.getByte(b, s + 1), ps);
+            WriteValueTools.writeUTF8StringNoQuotes(SUFFIX_STRING, ps);
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return AInt8Printer.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinter.java
deleted file mode 100644
index da331f5..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinter.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
-import org.apache.asterix.om.types.ATypeTag;
-import org.apache.asterix.om.types.EnumDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class AIntervalPrinter implements IPrinter {
-
-    public static final AIntervalPrinter INSTANCE = new AIntervalPrinter();
-
-    /* (non-Javadoc)
-     * @see org.apache.hyracks.algebricks.data.IPrinter#init()
-     */
-    @Override
-    public void init() {
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.hyracks.algebricks.data.IPrinter#print(byte[], int, int, java.io.PrintStream)
-     */
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print("interval(");
-
-        byte typetag = AIntervalSerializerDeserializer.getIntervalTimeType(b, s + 1);
-        int startOffset = AIntervalSerializerDeserializer.getIntervalStartOffset(b, s + 1) - 1;
-        int startSize = AIntervalSerializerDeserializer.getStartSize(b, s + 1);
-        int endOffset = AIntervalSerializerDeserializer.getIntervalEndOffset(b, s + 1) - 1;
-        int endSize = AIntervalSerializerDeserializer.getEndSize(b, s + 1);
-
-        IPrinter timeInstancePrinter;
-        ATypeTag intervalType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typetag);
-        switch (intervalType) {
-            case DATE:
-                timeInstancePrinter = ADatePrinter.INSTANCE;
-                break;
-            case TIME:
-                timeInstancePrinter = ATimePrinter.INSTANCE;
-                break;
-            case DATETIME:
-                timeInstancePrinter = ADateTimePrinter.INSTANCE;
-                break;
-            default:
-                throw new HyracksDataException("Unsupported internal time types in interval: " + typetag);
-        }
-
-        timeInstancePrinter.print(b, startOffset, startSize, ps);
-        ps.print(", ");
-        timeInstancePrinter.print(b, endOffset, endSize, ps);
-
-        ps.print(")");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinterFactory.java
index 95dd10d..106b765 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AIntervalPrinterFactory.java
@@ -18,17 +18,48 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
+import org.apache.asterix.om.types.EnumDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public class AIntervalPrinterFactory implements IPrinterFactory {
 
     private static final long serialVersionUID = 1L;
     public static final AIntervalPrinterFactory INSTANCE = new AIntervalPrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        ps.print("interval(");
+        byte typetag = AIntervalSerializerDeserializer.getIntervalTimeType(b, s + 1);
+        int startOffset = AIntervalSerializerDeserializer.getIntervalStartOffset(b, s + 1) - 1;
+        int startSize = AIntervalSerializerDeserializer.getStartSize(b, s + 1);
+        int endOffset = AIntervalSerializerDeserializer.getIntervalEndOffset(b, s + 1) - 1;
+        int endSize = AIntervalSerializerDeserializer.getEndSize(b, s + 1);
+        IPrinter timeInstancePrinter = getIPrinter(typetag);
+        timeInstancePrinter.print(b, startOffset, startSize, ps);
+        ps.print(", ");
+        timeInstancePrinter.print(b, endOffset, endSize, ps);
+        ps.print(")");
+    };
+
+    private static IPrinter getIPrinter(byte typetag) throws HyracksDataException {
+        switch (EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typetag)) {
+            case DATE:
+                return ADatePrinterFactory.PRINTER;
+            case TIME:
+                return ATimePrinterFactory.PRINTER;
+            case DATETIME:
+                return ADateTimePrinterFactory.PRINTER;
+            default:
+                throw new HyracksDataException("Unsupported internal time types in interval: " + typetag);
+        }
+    }
+
     @Override
     public IPrinter createPrinter() {
-        return AIntervalPrinter.INSTANCE;
+        return PRINTER;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinter.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinter.java
deleted file mode 100644
index b42bc09..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinter.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.dataflow.data.nontagged.printers.adm;
-
-import java.io.PrintStream;
-
-import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
-import org.apache.hyracks.algebricks.data.IPrinter;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class ALinePrinter implements IPrinter {
-
-    public static final ALinePrinter INSTANCE = new ALinePrinter();
-
-    @Override
-    public void init() {
-    }
-
-    @Override
-    public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException {
-        ps.print("line(\"");
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
-        ps.print(",");
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
-        ps.print(" ");
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
-        ps.print(",");
-        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25));
-        ps.print("\")");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/fd7fb5a1/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinterFactory.java
index 8cade11..d6b3e17 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinterFactory.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ALinePrinterFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import java.io.PrintStream;
+
+import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import org.apache.hyracks.algebricks.data.IPrinter;
 import org.apache.hyracks.algebricks.data.IPrinterFactory;
 
@@ -26,9 +29,20 @@ public class ALinePrinterFactory implements IPrinterFactory {
     private static final long serialVersionUID = 1L;
     public static final ALinePrinterFactory INSTANCE = new ALinePrinterFactory();
 
+    public static final IPrinter PRINTER = (byte[] b, int s, int l, PrintStream ps) -> {
+        ps.print("line(\"");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+        ps.print(",");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
+        ps.print(" ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
+        ps.print(",");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25));
+        ps.print("\")");
+    };
+
     @Override
     public IPrinter createPrinter() {
-        return ALinePrinter.INSTANCE;
+        return PRINTER;
     }
-
 }



Mime
View raw message