List of usage examples for org.apache.hadoop.hdfs.server.namenode FSEditLogOpCodes OP_END_LOG_SEGMENT
FSEditLogOpCodes OP_END_LOG_SEGMENT
To view the source code for org.apache.hadoop.hdfs.server.namenode FSEditLogOpCodes OP_END_LOG_SEGMENT.
Click Source Link
From source file:com.github.brandtg.switchboard.HdfsLogParser.java
License:Apache License
@Override protected FSEditLogOp nextOp() throws IOException { switch (state) { case UNINIT:/*from w w w . j a va 2 s . c o m*/ try { tracker = new FSEditLogLoader.PositionTrackingInputStream(inputStream); dataInputStream = new DataInputStream(tracker); logVersion = dataInputStream.readInt(); if (NameNodeLayoutVersion.supports(LayoutVersion.Feature.ADD_LAYOUT_FLAGS, logVersion) || logVersion < NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION) { LayoutFlags.read(dataInputStream); } reader = new FSEditLogOp.Reader(dataInputStream, tracker, logVersion); reader.setMaxOpSize(maxOpSize); state = State.OPEN; } finally { if (reader == null) { dataInputStream.close(); tracker.close(); state = State.CLOSED; } } return nextOp(); case OPEN: FSEditLogOp op = reader.readOp(false); if (op.opCode == FSEditLogOpCodes.OP_END_LOG_SEGMENT) { state = State.UNINIT; } return op; case CLOSED: default: return null; } }