Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ private static void putAcceptableType(TajoDataTypes.Type given, TajoDataTypes.Ty
putAcceptableType(DATE, DATE);

putAcceptableType(TEXT, TEXT);

putAcceptableType(INET4, INET4);
}

public static boolean isUpperCastable(TajoDataTypes.Type define, TajoDataTypes.Type given) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,6 @@ public enum Direction {

TUtil.putToNestedMap(OPERATION_CASTING_MAP, Type.INTERVAL, Type.DATE, Type.TIMESTAMP);
TUtil.putToNestedMap(CASTING_DIRECTION_MAP, Type.INTERVAL, Type.DATE, Direction.RHS);

TUtil.putToNestedMap(OPERATION_CASTING_MAP, Type.INET4, Type.INET4, Type.INET4);
}

// table default properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ public static int getColByteSize(Column col) {
return 4;
case FLOAT8:
return 8;
case INET4:
return 4;
case INET6:
return 16;
case TEXT:
return 256;
case BLOB:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ public Tuple toTuple(byte[] bytes) {
tuple.put(i, DatumFactory.createBlob(_bytes));
break;

case INET4:
byte[] _ipv4 = new byte[4];
bb.get(_ipv4);
tuple.put(i, DatumFactory.createInet4(_ipv4));
break;

default:
throw new TajoRuntimeException(
new UnsupportedException("data type '" + col.getDataType().getType().name() + "'"));
Expand Down Expand Up @@ -251,13 +245,6 @@ public byte[] toBytes(Tuple tuple) {
bb.putInt(bytes.length);
bb.put(bytes);
break;
case INET4:
byte[] ipBytes = tuple.getBytes(i);
bb.put(ipBytes);
break;
case INET6:
bb.put(tuple.getBytes(i));
break;
default:
throw new TajoRuntimeException(
new UnsupportedException("data type '" + col.getDataType().getType().name() + "'"));
Expand Down Expand Up @@ -316,10 +303,6 @@ private int estimateTupleDataSize(Tuple tuple) {
case BLOB:
size += (4 + tuple.getBytes(i).length);
break;
case INET4:
case INET6:
size += tuple.getBytes(i).length;
break;
default:
throw new TajoRuntimeException(
new UnsupportedException("data type '" + col.getDataType().getType().name() + "'"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public static boolean isSigned(Type type) {
case DATE:
case TIME:
case TIMESTAMP:
case INET4:
case VARCHAR:
case CHAR:
case TEXT: return false;
Expand Down
24 changes: 0 additions & 24 deletions tajo-common/src/main/java/org/apache/tajo/datum/DatumFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public static Class<? extends Datum> getDatumClass(Type type) {
return BitDatum.class;
case BLOB:
return BlobDatum.class;
case INET4:
return Inet4Datum.class;
case ANY:
return AnyDatum.class;
case NULL_TYPE:
Expand Down Expand Up @@ -106,8 +104,6 @@ public static Datum createFromString(DataType dataType, String value) {
return createInterval(value);
case BLOB:
return createBlob(value);
case INET4:
return createInet4(value);
default:
throw new TajoRuntimeException(new UnsupportedDataTypeException(dataType.toString()));
}
Expand Down Expand Up @@ -142,8 +138,6 @@ public static Datum createFromBytes(DataType dataType, byte[] bytes) {
return createBit(bytes[0]);
case BLOB:
return createBlob(bytes);
case INET4:
return createInet4(bytes);
case PROTOBUF:
try {
return ProtobufDatumFactory.createDatum(dataType, bytes);
Expand Down Expand Up @@ -386,22 +380,6 @@ public static BlobDatum createBlob(String plainString) {
return new BlobDatum(Base64.encodeBase64(plainString.getBytes()));
}

public static Inet4Datum createInet4(int encoded) {
return new Inet4Datum(encoded);
}

public static Inet4Datum createInet4(byte[] val) {
return new Inet4Datum(val);
}

public static Inet4Datum createInet4(byte[] val, int offset, int length) {
return new Inet4Datum(val, offset, length);
}

public static Inet4Datum createInet4(String val) {
return new Inet4Datum(val);
}

public static AnyDatum createAny(Datum val) {
return new AnyDatum(val);
}
Expand Down Expand Up @@ -445,8 +423,6 @@ public static Datum cast(Datum operandDatum, DataType target, @Nullable TimeZone
return DatumFactory.createTimestamp(operandDatum, tz);
case BLOB:
return DatumFactory.createBlob(operandDatum.asByteArray());
case INET4:
return DatumFactory.createInet4(operandDatum.asByteArray());
case ANY:
return DatumFactory.createAny(operandDatum);
default:
Expand Down
140 changes: 0 additions & 140 deletions tajo-common/src/main/java/org/apache/tajo/datum/Inet4Datum.java

This file was deleted.

20 changes: 0 additions & 20 deletions tajo-common/src/main/java/org/apache/tajo/storage/VTuple.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@
import com.google.gson.annotations.Expose;
import org.apache.tajo.common.TajoDataTypes;
import org.apache.tajo.datum.Datum;
import org.apache.tajo.datum.Inet4Datum;
import org.apache.tajo.datum.IntervalDatum;
import org.apache.tajo.datum.ProtobufDatum;
import org.apache.tajo.exception.NotImplementedException;
import org.apache.tajo.exception.TajoRuntimeException;
import org.apache.tajo.util.datetime.TimeMeta;

import java.net.InetAddress;
import java.util.Arrays;

public class VTuple implements Tuple, Cloneable {
Expand Down Expand Up @@ -177,22 +173,6 @@ public double getFloat8(int fieldId) {
return values[fieldId].asFloat8();
}

public Inet4Datum getIPv4(int fieldId) {
return (Inet4Datum) values[fieldId];
}

public byte [] getIPv4Bytes(int fieldId) {
return values[fieldId].asByteArray();
}

public InetAddress getIPv6(int fieldId) {
throw new TajoRuntimeException(new NotImplementedException());
}

public byte[] getIPv6Bytes(int fieldId) {
throw new TajoRuntimeException(new NotImplementedException());
}

@Override
public String getText(int fieldId) {
return values[fieldId].asChars();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,16 +405,6 @@ public void putInterval(IntervalDatum val) {
forwardField(length);
}

@Override
public void putInet4(int val) {
ensureSize(SizeOf.SIZE_OF_INT);
long addr = currentAddr();

PlatformDependent.putInt(addr, val);
curFieldIdx++;
forwardField(SizeOf.SIZE_OF_INT);
}

@Override
public void putProtoDatum(ProtobufDatum val) {
putBlob(val.asByteArray());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ public Datum asDatum(int fieldId) {
return DatumFactory.createTime(getInt8(fieldId));
case INTERVAL:
return getInterval(fieldId);
case INET4:
return DatumFactory.createInet4(getInt4(fieldId));
case PROTOBUF:
return getProtobufDatum(fieldId);
case NULL_TYPE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ public static final int compareColumn(UnSafeTuple tuple1, UnSafeTuple tuple2, in
case INT4:
compare = Ints.compare(tuple1.getInt4(index), tuple2.getInt4(index));
break;
case INET4:
compare = UnsignedInts.compare(tuple1.getInt4(index), tuple2.getInt4(index));
break;
case TIME:
case TIMESTAMP:
case INT8:
Expand Down Expand Up @@ -214,9 +211,6 @@ protected void writeField(int colIdx, Tuple tuple, RowWriter writer) {
case PROTOBUF:
writer.putProtoDatum((ProtobufDatum) tuple.getProtobufDatum(colIdx));
break;
case INET4:
writer.putInet4(tuple.getInt4(colIdx));
break;
case NULL_TYPE:
writer.skipField();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@ public void putInterval(IntervalDatum val) {
forwardField(SizeOf.SIZE_OF_INT + SizeOf.SIZE_OF_LONG);
}

@Override
public void putInet4(int val) {
putInt4(val);
}

@Override
public void putProtoDatum(ProtobufDatum val) {
putBlob(val.asByteArray());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public interface RowWriter {

void putInterval(IntervalDatum val);

void putInet4(int val);

void putProtoDatum(ProtobufDatum datum);

boolean addTuple(Tuple tuple);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ public Datum asDatum(int fieldId) {
return DatumFactory.createTime(getInt8(fieldId));
case INTERVAL:
return getInterval(fieldId);
case INET4:
return DatumFactory.createInet4(getInt4(fieldId));
case PROTOBUF:
return getProtobufDatum(fieldId);
case NULL_TYPE:
Expand Down
Loading