protected List<? extends ObjectInspector> extractFieldObjectInspectors(Class<?> clazz, ObjectInspectorFactory.ObjectInspectorOptions options) { Field[] fields = ObjectInspectorUtils.getDeclaredNonStaticFields(clazz); ArrayList<ObjectInspector> structFieldObjectInspectors = new ArrayList<ObjectInspector>( fields.length); for (int i = 0; i < fields.length; i++) { if (!shouldIgnoreField(fields[i].getName())) { structFieldObjectInspectors.add(ObjectInspectorFactory.getReflectionObjectInspector(fields[i] .getGenericType(), options, false)); } } return structFieldObjectInspectors; }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ protected void init(Type type, Class<?> objectClass, ObjectInspectorFactory.ObjectInspectorOptions options) { this.type = type; verifyObjectClassType(objectClass); this.objectClass = objectClass; final List<? extends ObjectInspector> structFieldObjectInspectors = extractFieldObjectInspectors(objectClass, options); Field[] reflectionFields = ObjectInspectorUtils .getDeclaredNonStaticFields(objectClass); synchronized (this) { fields = new ArrayList<MyField>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors .get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); inited = true; notifyAll(); } }
continue; Field[] fArr = ObjectInspectorUtils.getDeclaredNonStaticFields(agg.getClass()); for (Field f : fArr) { fixedRowSize += getSize(i, f.getType(), f);
continue; Field[] fArr = ObjectInspectorUtils.getDeclaredNonStaticFields(agg.getClass()); for (Field f : fArr) { fixedRowSize += getSize(i, f.getType(), f);
Field[] fields = ObjectInspectorUtils.getDeclaredNonStaticFields(c); ArrayList<String> fieldNames = new ArrayList<String>(fields.length); ArrayList<TypeInfo> fieldTypeInfos = new ArrayList<TypeInfo>(fields.length);
.getDeclaredNonStaticFields(agg.getClass()); for (Field f : fArr) { long avgSize = StatsUtils
.getDeclaredNonStaticFields(agg.getClass()); for (Field f : fArr) { long avgSize = StatsUtils
protected List<? extends ObjectInspector> extractFieldObjectInspectors(Class<?> clazz, ObjectInspectorFactory.ObjectInspectorOptions options) { Field[] fields = ObjectInspectorUtils.getDeclaredNonStaticFields(clazz); ArrayList<ObjectInspector> structFieldObjectInspectors = new ArrayList<ObjectInspector>( fields.length); for (int i = 0; i < fields.length; i++) { if (!shouldIgnoreField(fields[i].getName())) { structFieldObjectInspectors.add(ObjectInspectorFactory.getReflectionObjectInspector(fields[i] .getGenericType(), options)); } } return structFieldObjectInspectors; }
protected List<? extends ObjectInspector> extractFieldObjectInspectors(Class<?> clazz, ObjectInspectorFactory.ObjectInspectorOptions options) { Field[] fields = ObjectInspectorUtils.getDeclaredNonStaticFields(clazz); ArrayList<ObjectInspector> structFieldObjectInspectors = new ArrayList<ObjectInspector>( fields.length); for (int i = 0; i < fields.length; i++) { if (!shouldIgnoreField(fields[i].getName())) { structFieldObjectInspectors.add(ObjectInspectorFactory.getReflectionObjectInspector(fields[i] .getGenericType(), options)); } } return structFieldObjectInspectors; }
protected List<? extends ObjectInspector> extractFieldObjectInspectors(Class<?> clazz, ObjectInspectorFactory.ObjectInspectorOptions options) { Field[] fields = ObjectInspectorUtils.getDeclaredNonStaticFields(clazz); ArrayList<ObjectInspector> structFieldObjectInspectors = new ArrayList<ObjectInspector>( fields.length); for (int i = 0; i < fields.length; i++) { if (!shouldIgnoreField(fields[i].getName())) { structFieldObjectInspectors.add(ObjectInspectorFactory.getReflectionObjectInspector(fields[i] .getGenericType(), options, false)); } } return structFieldObjectInspectors; }
protected List<? extends ObjectInspector> extractFieldObjectInspectors(Class<?> clazz, ObjectInspectorFactory.ObjectInspectorOptions options) { Field[] fields = ObjectInspectorUtils.getDeclaredNonStaticFields(clazz); ArrayList<ObjectInspector> structFieldObjectInspectors = new ArrayList<ObjectInspector>( fields.length); for (int i = 0; i < fields.length; i++) { if (!shouldIgnoreField(fields[i].getName())) { structFieldObjectInspectors.add(ObjectInspectorFactory.getReflectionObjectInspector(fields[i] .getGenericType(), options)); } } return structFieldObjectInspectors; }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ void init(Class<?> objectClass, List<ObjectInspector> structFieldObjectInspectors) { assert (!List.class.isAssignableFrom(objectClass)); assert (!Map.class.isAssignableFrom(objectClass)); this.objectClass = objectClass; Field[] reflectionFields = ObjectInspectorUtils.getDeclaredNonStaticFields(objectClass); fields = new ArrayList<>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { // Exclude transient fields and synthetic fields. The latter has the effect of excluding the implicit // "this" pointer present in nested classes and that references the parent. if (Modifier.isTransient(reflectionFields[i].getModifiers()) || reflectionFields[i].isSynthetic()) { continue; } if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors.get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ void init(Class<?> objectClass, List<ObjectInspector> structFieldObjectInspectors) { assert (!List.class.isAssignableFrom(objectClass)); assert (!Map.class.isAssignableFrom(objectClass)); this.objectClass = objectClass; Field[] reflectionFields = ObjectInspectorUtils .getDeclaredNonStaticFields(objectClass); fields = new ArrayList<MyField>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(reflectionFields[i], structFieldObjectInspectors .get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ void init(Class<?> objectClass, List<ObjectInspector> structFieldObjectInspectors) { assert (!List.class.isAssignableFrom(objectClass)); assert (!Map.class.isAssignableFrom(objectClass)); this.objectClass = objectClass; Field[] reflectionFields = ObjectInspectorUtils.getDeclaredNonStaticFields(objectClass); fields = new ArrayList<>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { // Exclude transient fields and synthetic fields. The latter has the effect of excluding the implicit // "this" pointer present in nested classes and that references the parent. if (Modifier.isTransient(reflectionFields[i].getModifiers()) || reflectionFields[i].isSynthetic()) { continue; } if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors.get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ protected void init(Class<?> objectClass, ObjectInspectorFactory.ObjectInspectorOptions options) { verifyObjectClassType(objectClass); this.objectClass = objectClass; final List<? extends ObjectInspector> structFieldObjectInspectors = extractFieldObjectInspectors(objectClass, options); Field[] reflectionFields = ObjectInspectorUtils .getDeclaredNonStaticFields(objectClass); fields = new ArrayList<MyField>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors .get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ protected void init(Type type, Class<?> objectClass, ObjectInspectorFactory.ObjectInspectorOptions options) { this.type = type; verifyObjectClassType(objectClass); this.objectClass = objectClass; final List<? extends ObjectInspector> structFieldObjectInspectors = extractFieldObjectInspectors(objectClass, options); Field[] reflectionFields = ObjectInspectorUtils .getDeclaredNonStaticFields(objectClass); synchronized (this) { fields = new ArrayList<MyField>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors .get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); inited = true; notifyAll(); } }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ protected void init(Class<?> objectClass, ObjectInspectorFactory.ObjectInspectorOptions options) { verifyObjectClassType(objectClass); this.objectClass = objectClass; final List<? extends ObjectInspector> structFieldObjectInspectors = extractFieldObjectInspectors(objectClass, options); Field[] reflectionFields = ObjectInspectorUtils .getDeclaredNonStaticFields(objectClass); fields = new ArrayList<MyField>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors .get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); }
/** * This method is only intended to be used by Utilities class in this package. * The reason that this method is not recursive by itself is because we want * to allow recursive types. */ protected void init(Class<?> objectClass, ObjectInspectorFactory.ObjectInspectorOptions options) { verifyObjectClassType(objectClass); this.objectClass = objectClass; final List<? extends ObjectInspector> structFieldObjectInspectors = extractFieldObjectInspectors(objectClass, options); Field[] reflectionFields = ObjectInspectorUtils .getDeclaredNonStaticFields(objectClass); fields = new ArrayList<MyField>(structFieldObjectInspectors.size()); int used = 0; for (int i = 0; i < reflectionFields.length; i++) { if (!shouldIgnoreField(reflectionFields[i].getName())) { reflectionFields[i].setAccessible(true); fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors .get(used++))); } } assert (fields.size() == structFieldObjectInspectors.size()); }
/** * @return the size of each row **/ private void estimateRowSize() throws HiveException { // estimate the size of each entry - // a datatype with unknown size (String/Struct etc. - is assumed to be 256 // bytes for now). // 64 bytes is the overhead for a reference fixedRowSize = javaHashEntryOverHead; ArrayList<ExprNodeDesc> keys = conf.getKeys(); // Go over all the keys and get the size of the fields of fixed length. Keep // track of the variable length keys for (int pos = 0; pos < keys.size(); pos++) { fixedRowSize += getSize(pos, keys.get(pos).getTypeInfo()); } // Go over all the aggregation classes and and get the size of the fields of // fixed length. Keep track of the variable length // fields in these aggregation classes. for (int i = 0; i < aggregationEvaluators.length; i++) { fixedRowSize += javaObjectOverHead; Class<? extends AggregationBuffer> agg = aggregationEvaluators[i] .getNewAggregationBuffer().getClass(); Field[] fArr = ObjectInspectorUtils.getDeclaredNonStaticFields(agg); for (Field f : fArr) { fixedRowSize += getSize(i, f.getType(), f); } } }
continue; Field[] fArr = ObjectInspectorUtils.getDeclaredNonStaticFields(agg.getClass()); for (Field f : fArr) { fixedRowSize += getSize(i, f.getType(), f);