@Override public void readFields(DataInput in) throws IOException { int ordinal = in.readInt(); contentType = ContentType.valueOf(ordinal); int length = WritableUtils.readVInt(in); if (length > MAX_BUFFER_SIZE) { is = (DataInputStream)in; return; } content = new byte[length]; in.readFully(content, 0, length); }
@SuppressWarnings("unchecked") protected void initConfig(TaskAttemptContext context) { conf = context.getConfiguration(); String type = conf.get(MarkLogicConstants.CONTENT_TYPE, MarkLogicConstants.DEFAULT_CONTENT_TYPE); if (!conf.getBoolean(MarkLogicConstants.OUTPUT_STREAMING, false)) { ContentType contentType = ContentType.valueOf(type); Class<? extends Writable> valueClass = contentType.getWritableClass(); value = (VALUEIN) ReflectionUtils.newInstance(valueClass, conf); } encoding = conf.get(MarkLogicConstants.OUTPUT_CONTENT_ENCODING, DEFAULT_ENCODING); }
protected void initStream(InputSplit inSplit) throws IOException { FSDataInputStream fileIn = openFile(inSplit, false); if (fileIn == null) { return; } int index = file.toUri().getPath().lastIndexOf(EXTENSION); String subStr = file.toUri().getPath().substring(0, index); index = subStr.lastIndexOf('-'); String typeStr = subStr.substring(index + 1, subStr.length()); type = ContentType.valueOf(typeStr); value = new DatabaseDocumentWithMeta(); zipIn = new ZipInputStream(fileIn); }
@Override public void readFields(DataInput in) throws IOException { int contentLen = WritableUtils.readVInt(in); if (0 != contentLen) { content = new byte[contentLen]; in.readFully(content, 0, contentLen); int ordinal = in.readInt(); contentType = ContentType.valueOf(ordinal); } int len = in.readInt(); if (0 != len) { byte[] xml = new byte[len]; in.readFully(xml, 0, len); StringReader reader = new StringReader(new String(xml)); meta = DocumentMetadata.fromXML(reader); } }
ContentType.valueOf(typeStr); } catch (IllegalArgumentException ex) { LOG.error("Not a valid archive: " + zipfile);
String contentTypeStr = conf.get(MarkLogicConstants.CONTENT_TYPE, MarkLogicConstants.DEFAULT_CONTENT_TYPE); contentType = ContentType.valueOf(contentTypeStr); queries = new AdhocQuery[sessions.length];
ContentType contentType = ContentType.valueOf(contentTypeStr); if (contentType == ContentType.UNKNOWN) { formatNeeded = true;