You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2013/09/12 03:21:29 UTC
svn commit: r1522098 [4/30] - in /hive/branches/vectorization: ./
beeline/src/test/org/apache/hive/beeline/src/test/ bin/ bin/ext/
common/src/java/org/apache/hadoop/hive/common/
common/src/java/org/apache/hadoop/hive/conf/ conf/ contrib/src/java/org/ap...
Modified: hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/gen-java/org/apache/hcatalog/hbase/snapshot/transaction/thrift/StoreFamilyRevisionList.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/gen-java/org/apache/hcatalog/hbase/snapshot/transaction/thrift/StoreFamilyRevisionList.java?rev=1522098&r1=1522097&r2=1522098&view=diff
==============================================================================
--- hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/gen-java/org/apache/hcatalog/hbase/snapshot/transaction/thrift/StoreFamilyRevisionList.java (original)
+++ hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/gen-java/org/apache/hcatalog/hbase/snapshot/transaction/thrift/StoreFamilyRevisionList.java Thu Sep 12 01:21:10 2013
@@ -36,334 +36,334 @@ import java.util.List;
import java.util.Map;
public class StoreFamilyRevisionList implements org.apache.thrift.TBase<StoreFamilyRevisionList, StoreFamilyRevisionList._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StoreFamilyRevisionList");
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StoreFamilyRevisionList");
- private static final org.apache.thrift.protocol.TField REVISION_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("revisionList", org.apache.thrift.protocol.TType.LIST, (short) 1);
+ private static final org.apache.thrift.protocol.TField REVISION_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("revisionList", org.apache.thrift.protocol.TType.LIST, (short) 1);
- public List<StoreFamilyRevision> revisionList; // required
+ public List<StoreFamilyRevision> revisionList; // required
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- REVISION_LIST((short) 1, "revisionList");
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ REVISION_LIST((short) 1, "revisionList");
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch (fieldId) {
- case 1: // REVISION_LIST
- return REVISION_LIST;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
-
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.REVISION_LIST, new org.apache.thrift.meta_data.FieldMetaData("revisionList", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StoreFamilyRevision.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StoreFamilyRevisionList.class, metaDataMap);
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
}
- public StoreFamilyRevisionList() {
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch (fieldId) {
+ case 1: // REVISION_LIST
+ return REVISION_LIST;
+ default:
+ return null;
+ }
}
- public StoreFamilyRevisionList(
- List<StoreFamilyRevision> revisionList) {
- this();
- this.revisionList = revisionList;
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
}
/**
- * Performs a deep copy on <i>other</i>.
+ * Find the _Fields constant that matches name, or null if its not found.
*/
- public StoreFamilyRevisionList(StoreFamilyRevisionList other) {
- if (other.isSetRevisionList()) {
- List<StoreFamilyRevision> __this__revisionList = new ArrayList<StoreFamilyRevision>();
- for (StoreFamilyRevision other_element : other.revisionList) {
- __this__revisionList.add(new StoreFamilyRevision(other_element));
- }
- this.revisionList = __this__revisionList;
- }
+ public static _Fields findByName(String name) {
+ return byName.get(name);
}
- public StoreFamilyRevisionList deepCopy() {
- return new StoreFamilyRevisionList(this);
- }
+ private final short _thriftId;
+ private final String _fieldName;
- @Override
- public void clear() {
- this.revisionList = null;
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
}
- public int getRevisionListSize() {
- return (this.revisionList == null) ? 0 : this.revisionList.size();
+ public short getThriftFieldId() {
+ return _thriftId;
}
- public java.util.Iterator<StoreFamilyRevision> getRevisionListIterator() {
- return (this.revisionList == null) ? null : this.revisionList.iterator();
+ public String getFieldName() {
+ return _fieldName;
}
+ }
- public void addToRevisionList(StoreFamilyRevision elem) {
- if (this.revisionList == null) {
- this.revisionList = new ArrayList<StoreFamilyRevision>();
- }
- this.revisionList.add(elem);
- }
+ // isset id assignments
- public List<StoreFamilyRevision> getRevisionList() {
- return this.revisionList;
- }
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- public StoreFamilyRevisionList setRevisionList(List<StoreFamilyRevision> revisionList) {
- this.revisionList = revisionList;
- return this;
- }
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.REVISION_LIST, new org.apache.thrift.meta_data.FieldMetaData("revisionList", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StoreFamilyRevision.class))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StoreFamilyRevisionList.class, metaDataMap);
+ }
- public void unsetRevisionList() {
- this.revisionList = null;
- }
+ public StoreFamilyRevisionList() {
+ }
- /** Returns true if field revisionList is set (has been assigned a value) and false otherwise */
- public boolean isSetRevisionList() {
- return this.revisionList != null;
- }
+ public StoreFamilyRevisionList(
+ List<StoreFamilyRevision> revisionList) {
+ this();
+ this.revisionList = revisionList;
+ }
- public void setRevisionListIsSet(boolean value) {
- if (!value) {
- this.revisionList = null;
- }
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public StoreFamilyRevisionList(StoreFamilyRevisionList other) {
+ if (other.isSetRevisionList()) {
+ List<StoreFamilyRevision> __this__revisionList = new ArrayList<StoreFamilyRevision>();
+ for (StoreFamilyRevision other_element : other.revisionList) {
+ __this__revisionList.add(new StoreFamilyRevision(other_element));
+ }
+ this.revisionList = __this__revisionList;
}
+ }
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case REVISION_LIST:
- if (value == null) {
- unsetRevisionList();
- } else {
- setRevisionList((List<StoreFamilyRevision>) value);
- }
- break;
+ public StoreFamilyRevisionList deepCopy() {
+ return new StoreFamilyRevisionList(this);
+ }
- }
- }
+ @Override
+ public void clear() {
+ this.revisionList = null;
+ }
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case REVISION_LIST:
- return getRevisionList();
+ public int getRevisionListSize() {
+ return (this.revisionList == null) ? 0 : this.revisionList.size();
+ }
- }
- throw new IllegalStateException();
+ public java.util.Iterator<StoreFamilyRevision> getRevisionListIterator() {
+ return (this.revisionList == null) ? null : this.revisionList.iterator();
+ }
+
+ public void addToRevisionList(StoreFamilyRevision elem) {
+ if (this.revisionList == null) {
+ this.revisionList = new ArrayList<StoreFamilyRevision>();
}
+ this.revisionList.add(elem);
+ }
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
+ public List<StoreFamilyRevision> getRevisionList() {
+ return this.revisionList;
+ }
- switch (field) {
- case REVISION_LIST:
- return isSetRevisionList();
- }
- throw new IllegalStateException();
- }
+ public StoreFamilyRevisionList setRevisionList(List<StoreFamilyRevision> revisionList) {
+ this.revisionList = revisionList;
+ return this;
+ }
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof StoreFamilyRevisionList)
- return this.equals((StoreFamilyRevisionList) that);
- return false;
- }
+ public void unsetRevisionList() {
+ this.revisionList = null;
+ }
- public boolean equals(StoreFamilyRevisionList that) {
- if (that == null)
- return false;
-
- boolean this_present_revisionList = true && this.isSetRevisionList();
- boolean that_present_revisionList = true && that.isSetRevisionList();
- if (this_present_revisionList || that_present_revisionList) {
- if (!(this_present_revisionList && that_present_revisionList))
- return false;
- if (!this.revisionList.equals(that.revisionList))
- return false;
- }
+ /** Returns true if field revisionList is set (has been assigned a value) and false otherwise */
+ public boolean isSetRevisionList() {
+ return this.revisionList != null;
+ }
- return true;
+ public void setRevisionListIsSet(boolean value) {
+ if (!value) {
+ this.revisionList = null;
}
+ }
- @Override
- public int hashCode() {
- return 0;
- }
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case REVISION_LIST:
+ if (value == null) {
+ unsetRevisionList();
+ } else {
+ setRevisionList((List<StoreFamilyRevision>) value);
+ }
+ break;
- public int compareTo(StoreFamilyRevisionList other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
+ }
+ }
- int lastComparison = 0;
- StoreFamilyRevisionList typedOther = (StoreFamilyRevisionList) other;
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case REVISION_LIST:
+ return getRevisionList();
- lastComparison = Boolean.valueOf(isSetRevisionList()).compareTo(typedOther.isSetRevisionList());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetRevisionList()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.revisionList, typedOther.revisionList);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
}
+ throw new IllegalStateException();
+ }
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
}
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true) {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 1: // REVISION_LIST
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
- this.revisionList = new ArrayList<StoreFamilyRevision>(_list0.size);
- for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
- StoreFamilyRevision _elem2; // required
- _elem2 = new StoreFamilyRevision();
- _elem2.read(iprot);
- this.revisionList.add(_elem2);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ switch (field) {
+ case REVISION_LIST:
+ return isSetRevisionList();
}
+ throw new IllegalStateException();
+ }
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof StoreFamilyRevisionList)
+ return this.equals((StoreFamilyRevisionList) that);
+ return false;
+ }
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.revisionList != null) {
- oprot.writeFieldBegin(REVISION_LIST_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.revisionList.size()));
- for (StoreFamilyRevision _iter3 : this.revisionList) {
- _iter3.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
+ public boolean equals(StoreFamilyRevisionList that) {
+ if (that == null)
+ return false;
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("StoreFamilyRevisionList(");
- boolean first = true;
-
- sb.append("revisionList:");
- if (this.revisionList == null) {
- sb.append("null");
- } else {
- sb.append(this.revisionList);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
+ boolean this_present_revisionList = true && this.isSetRevisionList();
+ boolean that_present_revisionList = true && that.isSetRevisionList();
+ if (this_present_revisionList || that_present_revisionList) {
+ if (!(this_present_revisionList && that_present_revisionList))
+ return false;
+ if (!this.revisionList.equals(that.revisionList))
+ return false;
}
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
+ return true;
+ }
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(StoreFamilyRevisionList other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ StoreFamilyRevisionList typedOther = (StoreFamilyRevisionList) other;
+
+ lastComparison = Boolean.valueOf(isSetRevisionList()).compareTo(typedOther.isSetRevisionList());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRevisionList()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.revisionList, typedOther.revisionList);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField field;
+ iprot.readStructBegin();
+ while (true) {
+ field = iprot.readFieldBegin();
+ if (field.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (field.id) {
+ case 1: // REVISION_LIST
+ if (field.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
+ this.revisionList = new ArrayList<StoreFamilyRevision>(_list0.size);
+ for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
+ StoreFamilyRevision _elem2; // required
+ _elem2 = new StoreFamilyRevision();
+ _elem2.read(iprot);
+ this.revisionList.add(_elem2);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (this.revisionList != null) {
+ oprot.writeFieldBegin(REVISION_LIST_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.revisionList.size()));
+ for (StoreFamilyRevision _iter3 : this.revisionList) {
+ _iter3.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("StoreFamilyRevisionList(");
+ boolean first = true;
+
+ sb.append("revisionList:");
+ if (this.revisionList == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.revisionList);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
}
+ }
}
Modified: hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseAuthorizationProvider.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseAuthorizationProvider.java?rev=1522098&r1=1522097&r2=1522098&view=diff
==============================================================================
--- hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseAuthorizationProvider.java (original)
+++ hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseAuthorizationProvider.java Thu Sep 12 01:21:10 2013
@@ -37,108 +37,108 @@ import org.apache.hadoop.hive.ql.securit
*/
class HBaseAuthorizationProvider implements HiveAuthorizationProvider {
- @Override
- public Configuration getConf() {
- return null;
- }
-
- @Override
- public void setConf(Configuration conf) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
- * #init(org.apache.hadoop.conf.Configuration)
- */
- @Override
- public void init(Configuration conf) throws HiveException {
- }
-
- @Override
- public HiveAuthenticationProvider getAuthenticator() {
- return null;
- }
-
- @Override
- public void setAuthenticator(HiveAuthenticationProvider authenticator) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
- * #authorize(org.apache.hadoop.hive.ql.security.authorization.Privilege[],
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
- */
- @Override
- public void authorize(Privilege[] readRequiredPriv,
- Privilege[] writeRequiredPriv) throws HiveException,
- AuthorizationException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
- * #authorize(org.apache.hadoop.hive.metastore.api.Database,
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
- */
- @Override
- public void authorize(Database db, Privilege[] readRequiredPriv,
- Privilege[] writeRequiredPriv) throws HiveException,
- AuthorizationException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
- * #authorize(org.apache.hadoop.hive.ql.metadata.Table,
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
- */
- @Override
- public void authorize(Table table, Privilege[] readRequiredPriv,
- Privilege[] writeRequiredPriv) throws HiveException,
- AuthorizationException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
- * #authorize(org.apache.hadoop.hive.ql.metadata.Partition,
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
- */
- @Override
- public void authorize(Partition part, Privilege[] readRequiredPriv,
- Privilege[] writeRequiredPriv) throws HiveException,
- AuthorizationException {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
- * #authorize(org.apache.hadoop.hive.ql.metadata.Table,
- * org.apache.hadoop.hive.ql.metadata.Partition, java.util.List,
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
- * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
- */
- @Override
- public void authorize(Table table, Partition part, List<String> columns,
- Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv)
- throws HiveException, AuthorizationException {
- }
+ @Override
+ public Configuration getConf() {
+ return null;
+ }
+
+ @Override
+ public void setConf(Configuration conf) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
+ * #init(org.apache.hadoop.conf.Configuration)
+ */
+ @Override
+ public void init(Configuration conf) throws HiveException {
+ }
+
+ @Override
+ public HiveAuthenticationProvider getAuthenticator() {
+ return null;
+ }
+
+ @Override
+ public void setAuthenticator(HiveAuthenticationProvider authenticator) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
+ * #authorize(org.apache.hadoop.hive.ql.security.authorization.Privilege[],
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
+ */
+ @Override
+ public void authorize(Privilege[] readRequiredPriv,
+ Privilege[] writeRequiredPriv) throws HiveException,
+ AuthorizationException {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
+ * #authorize(org.apache.hadoop.hive.metastore.api.Database,
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
+ */
+ @Override
+ public void authorize(Database db, Privilege[] readRequiredPriv,
+ Privilege[] writeRequiredPriv) throws HiveException,
+ AuthorizationException {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
+ * #authorize(org.apache.hadoop.hive.ql.metadata.Table,
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
+ */
+ @Override
+ public void authorize(Table table, Privilege[] readRequiredPriv,
+ Privilege[] writeRequiredPriv) throws HiveException,
+ AuthorizationException {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
+ * #authorize(org.apache.hadoop.hive.ql.metadata.Partition,
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
+ */
+ @Override
+ public void authorize(Partition part, Privilege[] readRequiredPriv,
+ Privilege[] writeRequiredPriv) throws HiveException,
+ AuthorizationException {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider
+ * #authorize(org.apache.hadoop.hive.ql.metadata.Table,
+ * org.apache.hadoop.hive.ql.metadata.Partition, java.util.List,
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[],
+ * org.apache.hadoop.hive.ql.security.authorization.Privilege[])
+ */
+ @Override
+ public void authorize(Table table, Partition part, List<String> columns,
+ Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv)
+ throws HiveException, AuthorizationException {
+ }
}
Modified: hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBaseOutputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBaseOutputFormat.java?rev=1522098&r1=1522097&r2=1522098&view=diff
==============================================================================
--- hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBaseOutputFormat.java (original)
+++ hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBaseOutputFormat.java Thu Sep 12 01:21:10 2013
@@ -32,45 +32,45 @@ import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.OutputFormat;
import org.apache.hadoop.mapred.RecordWriter;
import org.apache.hadoop.util.Progressable;
-import org.apache.hcatalog.common.HCatConstants;
-import org.apache.hcatalog.common.HCatUtil;
-import org.apache.hcatalog.mapreduce.OutputJobInfo;
+import org.apache.hive.hcatalog.common.HCatConstants;
+import org.apache.hive.hcatalog.common.HCatUtil;
+import org.apache.hive.hcatalog.mapreduce.OutputJobInfo;
public class HBaseBaseOutputFormat implements OutputFormat<WritableComparable<?>, Put>,
- HiveOutputFormat<WritableComparable<?>, Put> {
+ HiveOutputFormat<WritableComparable<?>, Put> {
- @Override
- public org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter getHiveRecordWriter(
- JobConf jc, Path finalOutPath,
- Class<? extends Writable> valueClass, boolean isCompressed,
- Properties tableProperties, Progressable progress)
- throws IOException {
- throw new UnsupportedOperationException("Not implemented");
- }
+ @Override
+ public org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter getHiveRecordWriter(
+ JobConf jc, Path finalOutPath,
+ Class<? extends Writable> valueClass, boolean isCompressed,
+ Properties tableProperties, Progressable progress)
+ throws IOException {
+ throw new UnsupportedOperationException("Not implemented");
+ }
- @Override
- public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException {
- OutputFormat<WritableComparable<?>, Put> outputFormat = getOutputFormat(job);
- outputFormat.checkOutputSpecs(ignored, job);
- }
+ @Override
+ public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException {
+ OutputFormat<WritableComparable<?>, Put> outputFormat = getOutputFormat(job);
+ outputFormat.checkOutputSpecs(ignored, job);
+ }
- @Override
- public RecordWriter<WritableComparable<?>, Put> getRecordWriter(FileSystem ignored,
- JobConf job, String name, Progressable progress) throws IOException {
- OutputFormat<WritableComparable<?>, Put> outputFormat = getOutputFormat(job);
- return outputFormat.getRecordWriter(ignored, job, name, progress);
- }
+ @Override
+ public RecordWriter<WritableComparable<?>, Put> getRecordWriter(FileSystem ignored,
+ JobConf job, String name, Progressable progress) throws IOException {
+ OutputFormat<WritableComparable<?>, Put> outputFormat = getOutputFormat(job);
+ return outputFormat.getRecordWriter(ignored, job, name, progress);
+ }
- private OutputFormat<WritableComparable<?>, Put> getOutputFormat(JobConf job)
- throws IOException {
- String outputInfo = job.get(HCatConstants.HCAT_KEY_OUTPUT_INFO);
- OutputJobInfo outputJobInfo = (OutputJobInfo) HCatUtil.deserialize(outputInfo);
- OutputFormat<WritableComparable<?>, Put> outputFormat = null;
- if (HBaseHCatStorageHandler.isBulkMode(outputJobInfo)) {
- outputFormat = new HBaseBulkOutputFormat();
- } else {
- outputFormat = new HBaseDirectOutputFormat();
- }
- return outputFormat;
+ private OutputFormat<WritableComparable<?>, Put> getOutputFormat(JobConf job)
+ throws IOException {
+ String outputInfo = job.get(HCatConstants.HCAT_KEY_OUTPUT_INFO);
+ OutputJobInfo outputJobInfo = (OutputJobInfo) HCatUtil.deserialize(outputInfo);
+ OutputFormat<WritableComparable<?>, Put> outputFormat = null;
+ if (HBaseHCatStorageHandler.isBulkMode(outputJobInfo)) {
+ outputFormat = new HBaseBulkOutputFormat();
+ } else {
+ outputFormat = new HBaseDirectOutputFormat();
}
+ return outputFormat;
+ }
}
Modified: hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBulkOutputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBulkOutputFormat.java?rev=1522098&r1=1522097&r2=1522098&view=diff
==============================================================================
--- hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBulkOutputFormat.java (original)
+++ hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseBulkOutputFormat.java Thu Sep 12 01:21:10 2013
@@ -51,171 +51,171 @@ import org.apache.hcatalog.hbase.snapsho
*/
class HBaseBulkOutputFormat extends HBaseBaseOutputFormat {
- private final static ImmutableBytesWritable EMPTY_LIST = new ImmutableBytesWritable(
- new byte[0]);
- private SequenceFileOutputFormat<WritableComparable<?>, Put> baseOutputFormat;
-
- public HBaseBulkOutputFormat() {
- baseOutputFormat = new SequenceFileOutputFormat<WritableComparable<?>, Put>();
+ private final static ImmutableBytesWritable EMPTY_LIST = new ImmutableBytesWritable(
+ new byte[0]);
+ private SequenceFileOutputFormat<WritableComparable<?>, Put> baseOutputFormat;
+
+ public HBaseBulkOutputFormat() {
+ baseOutputFormat = new SequenceFileOutputFormat<WritableComparable<?>, Put>();
+ }
+
+ @Override
+ public void checkOutputSpecs(FileSystem ignored, JobConf job)
+ throws IOException {
+ baseOutputFormat.checkOutputSpecs(ignored, job);
+ HBaseUtil.addHBaseDelegationToken(job);
+ addJTDelegationToken(job);
+ }
+
+ @Override
+ public RecordWriter<WritableComparable<?>, Put> getRecordWriter(
+ FileSystem ignored, JobConf job, String name, Progressable progress)
+ throws IOException {
+ job.setOutputKeyClass(ImmutableBytesWritable.class);
+ job.setOutputValueClass(Put.class);
+ long version = HBaseRevisionManagerUtil.getOutputRevision(job);
+ return new HBaseBulkRecordWriter(baseOutputFormat.getRecordWriter(
+ ignored, job, name, progress), version);
+ }
+
+ private void addJTDelegationToken(JobConf job) throws IOException {
+ // Get jobTracker delegation token if security is enabled
+ // we need to launch the ImportSequenceFile job
+ if (User.isSecurityEnabled()) {
+ JobClient jobClient = new JobClient(new JobConf(job));
+ try {
+ job.getCredentials().addToken(new Text("my mr token"),
+ jobClient.getDelegationToken(null));
+ } catch (InterruptedException e) {
+ throw new IOException("Error while getting JT delegation token", e);
+ }
+ }
+ }
+
+ private static class HBaseBulkRecordWriter implements
+ RecordWriter<WritableComparable<?>, Put> {
+
+ private RecordWriter<WritableComparable<?>, Put> baseWriter;
+ private final Long outputVersion;
+
+ public HBaseBulkRecordWriter(
+ RecordWriter<WritableComparable<?>, Put> baseWriter,
+ Long outputVersion) {
+ this.baseWriter = baseWriter;
+ this.outputVersion = outputVersion;
}
@Override
- public void checkOutputSpecs(FileSystem ignored, JobConf job)
- throws IOException {
- baseOutputFormat.checkOutputSpecs(ignored, job);
- HBaseUtil.addHBaseDelegationToken(job);
- addJTDelegationToken(job);
+ public void write(WritableComparable<?> key, Put value)
+ throws IOException {
+ Put put = value;
+ if (outputVersion != null) {
+ put = new Put(value.getRow(), outputVersion.longValue());
+ for (List<KeyValue> row : value.getFamilyMap().values()) {
+ for (KeyValue el : row) {
+ put.add(el.getFamily(), el.getQualifier(), el.getValue());
+ }
+ }
+ }
+ // we ignore the key
+ baseWriter.write(EMPTY_LIST, put);
}
@Override
- public RecordWriter<WritableComparable<?>, Put> getRecordWriter(
- FileSystem ignored, JobConf job, String name, Progressable progress)
- throws IOException {
- job.setOutputKeyClass(ImmutableBytesWritable.class);
- job.setOutputValueClass(Put.class);
- long version = HBaseRevisionManagerUtil.getOutputRevision(job);
- return new HBaseBulkRecordWriter(baseOutputFormat.getRecordWriter(
- ignored, job, name, progress), version);
- }
-
- private void addJTDelegationToken(JobConf job) throws IOException {
- // Get jobTracker delegation token if security is enabled
- // we need to launch the ImportSequenceFile job
- if (User.isSecurityEnabled()) {
- JobClient jobClient = new JobClient(new JobConf(job));
- try {
- job.getCredentials().addToken(new Text("my mr token"),
- jobClient.getDelegationToken(null));
- } catch (InterruptedException e) {
- throw new IOException("Error while getting JT delegation token", e);
- }
- }
+ public void close(Reporter reporter) throws IOException {
+ baseWriter.close(reporter);
}
+ }
- private static class HBaseBulkRecordWriter implements
- RecordWriter<WritableComparable<?>, Put> {
-
- private RecordWriter<WritableComparable<?>, Put> baseWriter;
- private final Long outputVersion;
-
- public HBaseBulkRecordWriter(
- RecordWriter<WritableComparable<?>, Put> baseWriter,
- Long outputVersion) {
- this.baseWriter = baseWriter;
- this.outputVersion = outputVersion;
- }
+ public static class HBaseBulkOutputCommitter extends OutputCommitter {
- @Override
- public void write(WritableComparable<?> key, Put value)
- throws IOException {
- Put put = value;
- if (outputVersion != null) {
- put = new Put(value.getRow(), outputVersion.longValue());
- for (List<KeyValue> row : value.getFamilyMap().values()) {
- for (KeyValue el : row) {
- put.add(el.getFamily(), el.getQualifier(), el.getValue());
- }
- }
- }
- // we ignore the key
- baseWriter.write(EMPTY_LIST, put);
- }
+ private final OutputCommitter baseOutputCommitter;
- @Override
- public void close(Reporter reporter) throws IOException {
- baseWriter.close(reporter);
- }
+ public HBaseBulkOutputCommitter() {
+ baseOutputCommitter = new FileOutputCommitter();
}
- public static class HBaseBulkOutputCommitter extends OutputCommitter {
-
- private final OutputCommitter baseOutputCommitter;
-
- public HBaseBulkOutputCommitter() {
- baseOutputCommitter = new FileOutputCommitter();
- }
-
- @Override
- public void abortTask(TaskAttemptContext taskContext)
- throws IOException {
- baseOutputCommitter.abortTask(taskContext);
- }
-
- @Override
- public void commitTask(TaskAttemptContext taskContext)
- throws IOException {
- // baseOutputCommitter.commitTask(taskContext);
- }
+ @Override
+ public void abortTask(TaskAttemptContext taskContext)
+ throws IOException {
+ baseOutputCommitter.abortTask(taskContext);
+ }
- @Override
- public boolean needsTaskCommit(TaskAttemptContext taskContext)
- throws IOException {
- return baseOutputCommitter.needsTaskCommit(taskContext);
- }
+ @Override
+ public void commitTask(TaskAttemptContext taskContext)
+ throws IOException {
+ // baseOutputCommitter.commitTask(taskContext);
+ }
- @Override
- public void setupJob(JobContext jobContext) throws IOException {
- baseOutputCommitter.setupJob(jobContext);
- }
+ @Override
+ public boolean needsTaskCommit(TaskAttemptContext taskContext)
+ throws IOException {
+ return baseOutputCommitter.needsTaskCommit(taskContext);
+ }
- @Override
- public void setupTask(TaskAttemptContext taskContext)
- throws IOException {
- baseOutputCommitter.setupTask(taskContext);
- }
+ @Override
+ public void setupJob(JobContext jobContext) throws IOException {
+ baseOutputCommitter.setupJob(jobContext);
+ }
- @Override
- public void abortJob(JobContext jobContext, int status)
- throws IOException {
- baseOutputCommitter.abortJob(jobContext, status);
- RevisionManager rm = null;
- try {
- rm = HBaseRevisionManagerUtil
- .getOpenedRevisionManager(jobContext.getConfiguration());
- rm.abortWriteTransaction(HBaseRevisionManagerUtil
- .getWriteTransaction(jobContext.getConfiguration()));
- } finally {
- cleanIntermediate(jobContext);
- if (rm != null)
- rm.close();
- }
- }
+ @Override
+ public void setupTask(TaskAttemptContext taskContext)
+ throws IOException {
+ baseOutputCommitter.setupTask(taskContext);
+ }
- @Override
- public void commitJob(JobContext jobContext) throws IOException {
- baseOutputCommitter.commitJob(jobContext);
- RevisionManager rm = null;
- try {
- Configuration conf = jobContext.getConfiguration();
- Path srcPath = FileOutputFormat.getOutputPath(jobContext.getJobConf());
- if (!FileSystem.get(conf).exists(srcPath)) {
- throw new IOException("Failed to bulk import hfiles. " +
- "Intermediate data directory is cleaned up or missing. " +
- "Please look at the bulk import job if it exists for failure reason");
- }
- Path destPath = new Path(srcPath.getParent(), srcPath.getName() + "_hfiles");
- boolean success = ImportSequenceFile.runJob(jobContext,
- conf.get(HBaseConstants.PROPERTY_OUTPUT_TABLE_NAME_KEY),
- srcPath,
- destPath);
- if (!success) {
- cleanIntermediate(jobContext);
- throw new IOException("Failed to bulk import hfiles." +
- " Please look at the bulk import job for failure reason");
- }
- rm = HBaseRevisionManagerUtil.getOpenedRevisionManager(conf);
- rm.commitWriteTransaction(HBaseRevisionManagerUtil.getWriteTransaction(conf));
- cleanIntermediate(jobContext);
- } finally {
- if (rm != null)
- rm.close();
- }
- }
+ @Override
+ public void abortJob(JobContext jobContext, int status)
+ throws IOException {
+ baseOutputCommitter.abortJob(jobContext, status);
+ RevisionManager rm = null;
+ try {
+ rm = HBaseRevisionManagerUtil
+ .getOpenedRevisionManager(jobContext.getConfiguration());
+ rm.abortWriteTransaction(HBaseRevisionManagerUtil
+ .getWriteTransaction(jobContext.getConfiguration()));
+ } finally {
+ cleanIntermediate(jobContext);
+ if (rm != null)
+ rm.close();
+ }
+ }
- private void cleanIntermediate(JobContext jobContext)
- throws IOException {
- FileSystem fs = FileSystem.get(jobContext.getConfiguration());
- fs.delete(FileOutputFormat.getOutputPath(jobContext.getJobConf()), true);
- }
+ @Override
+ public void commitJob(JobContext jobContext) throws IOException {
+ baseOutputCommitter.commitJob(jobContext);
+ RevisionManager rm = null;
+ try {
+ Configuration conf = jobContext.getConfiguration();
+ Path srcPath = FileOutputFormat.getOutputPath(jobContext.getJobConf());
+ if (!FileSystem.get(conf).exists(srcPath)) {
+ throw new IOException("Failed to bulk import hfiles. " +
+ "Intermediate data directory is cleaned up or missing. " +
+ "Please look at the bulk import job if it exists for failure reason");
+ }
+ Path destPath = new Path(srcPath.getParent(), srcPath.getName() + "_hfiles");
+ boolean success = ImportSequenceFile.runJob(jobContext,
+ conf.get(HBaseConstants.PROPERTY_OUTPUT_TABLE_NAME_KEY),
+ srcPath,
+ destPath);
+ if (!success) {
+ cleanIntermediate(jobContext);
+ throw new IOException("Failed to bulk import hfiles." +
+ " Please look at the bulk import job for failure reason");
+ }
+ rm = HBaseRevisionManagerUtil.getOpenedRevisionManager(conf);
+ rm.commitWriteTransaction(HBaseRevisionManagerUtil.getWriteTransaction(conf));
+ cleanIntermediate(jobContext);
+ } finally {
+ if (rm != null)
+ rm.close();
+ }
+ }
+
+ private void cleanIntermediate(JobContext jobContext)
+ throws IOException {
+ FileSystem fs = FileSystem.get(jobContext.getConfiguration());
+ fs.delete(FileOutputFormat.getOutputPath(jobContext.getJobConf()), true);
}
+ }
}
Modified: hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseConstants.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseConstants.java?rev=1522098&r1=1522097&r2=1522098&view=diff
==============================================================================
--- hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseConstants.java (original)
+++ hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseConstants.java Thu Sep 12 01:21:10 2013
@@ -19,23 +19,23 @@
package org.apache.hcatalog.hbase;
-import org.apache.hcatalog.common.HCatConstants;
+import org.apache.hive.hcatalog.common.HCatConstants;
/**
* Constants class for constants used in HBase storage handler.
*/
class HBaseConstants {
- /** key used to store write transaction object */
- public static final String PROPERTY_WRITE_TXN_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + ".hbase.mapreduce.writeTxn";
+ /** key used to store write transaction object */
+ public static final String PROPERTY_WRITE_TXN_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + ".hbase.mapreduce.writeTxn";
- /** key used to define the name of the table to write to */
- public static final String PROPERTY_OUTPUT_TABLE_NAME_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + ".hbase.mapreduce.outputTableName";
+ /** key used to define the name of the table to write to */
+ public static final String PROPERTY_OUTPUT_TABLE_NAME_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + ".hbase.mapreduce.outputTableName";
- /** key used to define whether bulk storage output format will be used or not */
- public static final String PROPERTY_BULK_OUTPUT_MODE_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + ".hbase.output.bulkMode";
+ /** key used to define whether bulk storage output format will be used or not */
+ public static final String PROPERTY_BULK_OUTPUT_MODE_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + ".hbase.output.bulkMode";
- /** key used to define the hbase table snapshot. */
- public static final String PROPERTY_TABLE_SNAPSHOT_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + "hbase.table.snapshot";
+ /** key used to define the hbase table snapshot. */
+ public static final String PROPERTY_TABLE_SNAPSHOT_KEY = HCatConstants.HCAT_DEFAULT_TOPIC_PREFIX + "hbase.table.snapshot";
}
Modified: hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseDirectOutputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseDirectOutputFormat.java?rev=1522098&r1=1522097&r2=1522098&view=diff
==============================================================================
--- hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseDirectOutputFormat.java (original)
+++ hive/branches/vectorization/hcatalog/storage-handlers/hbase/src/java/org/apache/hcatalog/hbase/HBaseDirectOutputFormat.java Thu Sep 12 01:21:10 2013
@@ -46,122 +46,122 @@ import org.apache.hcatalog.hbase.snapsho
*/
class HBaseDirectOutputFormat extends HBaseBaseOutputFormat {
- private TableOutputFormat outputFormat;
+ private TableOutputFormat outputFormat;
- public HBaseDirectOutputFormat() {
- this.outputFormat = new TableOutputFormat();
+ public HBaseDirectOutputFormat() {
+ this.outputFormat = new TableOutputFormat();
+ }
+
+ @Override
+ public RecordWriter<WritableComparable<?>, Put> getRecordWriter(FileSystem ignored,
+ JobConf job, String name, Progressable progress)
+ throws IOException {
+ long version = HBaseRevisionManagerUtil.getOutputRevision(job);
+ return new HBaseDirectRecordWriter(outputFormat.getRecordWriter(ignored, job, name,
+ progress), version);
+ }
+
+ @Override
+ public void checkOutputSpecs(FileSystem ignored, JobConf job)
+ throws IOException {
+ outputFormat.checkOutputSpecs(ignored, job);
+ HBaseUtil.addHBaseDelegationToken(job);
+ }
+
+ private static class HBaseDirectRecordWriter implements
+ RecordWriter<WritableComparable<?>, Put> {
+
+ private RecordWriter<WritableComparable<?>, Put> baseWriter;
+ private final Long outputVersion;
+
+ public HBaseDirectRecordWriter(
+ RecordWriter<WritableComparable<?>, Put> baseWriter,
+ Long outputVersion) {
+ this.baseWriter = baseWriter;
+ this.outputVersion = outputVersion;
}
@Override
- public RecordWriter<WritableComparable<?>, Put> getRecordWriter(FileSystem ignored,
- JobConf job, String name, Progressable progress)
- throws IOException {
- long version = HBaseRevisionManagerUtil.getOutputRevision(job);
- return new HBaseDirectRecordWriter(outputFormat.getRecordWriter(ignored, job, name,
- progress), version);
+ public void write(WritableComparable<?> key, Put value)
+ throws IOException {
+ Put put = value;
+ if (outputVersion != null) {
+ put = new Put(value.getRow(), outputVersion.longValue());
+ for (List<KeyValue> row : value.getFamilyMap().values()) {
+ for (KeyValue el : row) {
+ put.add(el.getFamily(), el.getQualifier(), el.getValue());
+ }
+ }
+ }
+ baseWriter.write(key, put);
}
@Override
- public void checkOutputSpecs(FileSystem ignored, JobConf job)
- throws IOException {
- outputFormat.checkOutputSpecs(ignored, job);
- HBaseUtil.addHBaseDelegationToken(job);
+ public void close(Reporter reporter) throws IOException {
+ baseWriter.close(reporter);
}
- private static class HBaseDirectRecordWriter implements
- RecordWriter<WritableComparable<?>, Put> {
-
- private RecordWriter<WritableComparable<?>, Put> baseWriter;
- private final Long outputVersion;
-
- public HBaseDirectRecordWriter(
- RecordWriter<WritableComparable<?>, Put> baseWriter,
- Long outputVersion) {
- this.baseWriter = baseWriter;
- this.outputVersion = outputVersion;
- }
-
- @Override
- public void write(WritableComparable<?> key, Put value)
- throws IOException {
- Put put = value;
- if (outputVersion != null) {
- put = new Put(value.getRow(), outputVersion.longValue());
- for (List<KeyValue> row : value.getFamilyMap().values()) {
- for (KeyValue el : row) {
- put.add(el.getFamily(), el.getQualifier(), el.getValue());
- }
- }
- }
- baseWriter.write(key, put);
- }
+ }
- @Override
- public void close(Reporter reporter) throws IOException {
- baseWriter.close(reporter);
- }
+ public static class HBaseDirectOutputCommitter extends OutputCommitter {
+ public HBaseDirectOutputCommitter() throws IOException {
}
- public static class HBaseDirectOutputCommitter extends OutputCommitter {
-
- public HBaseDirectOutputCommitter() throws IOException {
- }
-
- @Override
- public void abortTask(TaskAttemptContext taskContext)
- throws IOException {
- }
+ @Override
+ public void abortTask(TaskAttemptContext taskContext)
+ throws IOException {
+ }
- @Override
- public void commitTask(TaskAttemptContext taskContext)
- throws IOException {
- }
+ @Override
+ public void commitTask(TaskAttemptContext taskContext)
+ throws IOException {
+ }
- @Override
- public boolean needsTaskCommit(TaskAttemptContext taskContext)
- throws IOException {
- return false;
- }
+ @Override
+ public boolean needsTaskCommit(TaskAttemptContext taskContext)
+ throws IOException {
+ return false;
+ }
- @Override
- public void setupJob(JobContext jobContext) throws IOException {
- }
+ @Override
+ public void setupJob(JobContext jobContext) throws IOException {
+ }
- @Override
- public void setupTask(TaskAttemptContext taskContext)
- throws IOException {
- }
+ @Override
+ public void setupTask(TaskAttemptContext taskContext)
+ throws IOException {
+ }
- @Override
- public void abortJob(JobContext jobContext, int status)
- throws IOException {
- super.abortJob(jobContext, status);
- RevisionManager rm = null;
- try {
- rm = HBaseRevisionManagerUtil
- .getOpenedRevisionManager(jobContext.getConfiguration());
- Transaction writeTransaction = HBaseRevisionManagerUtil
- .getWriteTransaction(jobContext.getConfiguration());
- rm.abortWriteTransaction(writeTransaction);
- } finally {
- if (rm != null)
- rm.close();
- }
- }
+ @Override
+ public void abortJob(JobContext jobContext, int status)
+ throws IOException {
+ super.abortJob(jobContext, status);
+ RevisionManager rm = null;
+ try {
+ rm = HBaseRevisionManagerUtil
+ .getOpenedRevisionManager(jobContext.getConfiguration());
+ Transaction writeTransaction = HBaseRevisionManagerUtil
+ .getWriteTransaction(jobContext.getConfiguration());
+ rm.abortWriteTransaction(writeTransaction);
+ } finally {
+ if (rm != null)
+ rm.close();
+ }
+ }
- @Override
- public void commitJob(JobContext jobContext) throws IOException {
- RevisionManager rm = null;
- try {
- rm = HBaseRevisionManagerUtil
- .getOpenedRevisionManager(jobContext.getConfiguration());
- rm.commitWriteTransaction(HBaseRevisionManagerUtil.getWriteTransaction(jobContext
- .getConfiguration()));
- } finally {
- if (rm != null)
- rm.close();
- }
- }
+ @Override
+ public void commitJob(JobContext jobContext) throws IOException {
+ RevisionManager rm = null;
+ try {
+ rm = HBaseRevisionManagerUtil
+ .getOpenedRevisionManager(jobContext.getConfiguration());
+ rm.commitWriteTransaction(HBaseRevisionManagerUtil.getWriteTransaction(jobContext
+ .getConfiguration()));
+ } finally {
+ if (rm != null)
+ rm.close();
+ }
}
+ }
}