use of cascading.tap.TapException in project SpyGlass by ParallelAI.
the class HBaseTap method obtainToken.
private void obtainToken(JobConf conf) {
if (User.isHBaseSecurityEnabled(conf)) {
String user = conf.getUser();
LOG.info("obtaining HBase token for: {}", user);
try {
UserGroupInformation currentUser = UserGroupInformation.getCurrentUser();
user = currentUser.getUserName();
Credentials credentials = conf.getCredentials();
for (Token t : currentUser.getTokens()) {
LOG.debug("Token {} is available", t);
if ("HBASE_AUTH_TOKEN".equalsIgnoreCase(t.getKind().toString()))
credentials.addToken(t.getKind(), t);
}
} catch (IOException e) {
throw new TapException("Unable to obtain HBase auth token for " + user, e);
}
}
}
use of cascading.tap.TapException in project SpyGlass by ParallelAI.
the class HBaseTapCollector method close.
@Override
public void close() {
try {
LOG.info("closing tap collector for: {}", tap);
writer.close(reporter);
} catch (IOException exception) {
LOG.warn("exception closing: {}", exception);
throw new TapException("exception closing HBaseTapCollector", exception);
} finally {
super.close();
}
}
use of cascading.tap.TapException in project SpyGlass by ParallelAI.
the class JDBCTap method createConnection.
private Connection createConnection() {
try {
LOG.info("creating connection: {}", connectionUrl);
Class.forName(driverClassName);
Connection connection = null;
if (username == null)
connection = DriverManager.getConnection(connectionUrl);
else
connection = DriverManager.getConnection(connectionUrl, username, password);
connection.setAutoCommit(false);
return connection;
} catch (ClassNotFoundException exception) {
throw new TapException("unable to load driver class: " + driverClassName, exception);
} catch (SQLException exception) {
throw new TapException("unable to open connection: " + connectionUrl, exception);
}
}
use of cascading.tap.TapException in project parquet-mr by apache.
the class ParquetTupleScheme method readSchema.
private MessageType readSchema(FlowProcess<? extends JobConf> flowProcess, Tap tap) {
try {
Hfs hfs;
if (tap instanceof CompositeTap)
hfs = (Hfs) ((CompositeTap) tap).getChildTaps().next();
else
hfs = (Hfs) tap;
List<Footer> footers = getFooters(flowProcess, hfs);
if (footers.isEmpty()) {
throw new TapException("Could not read Parquet metadata at " + hfs.getPath());
} else {
return footers.get(0).getParquetMetadata().getFileMetaData().getSchema();
}
} catch (IOException e) {
throw new TapException(e);
}
}
use of cascading.tap.TapException in project parquet-mr by apache.
the class ParquetTupleScheme method readSchema.
private MessageType readSchema(FlowProcess<JobConf> flowProcess, Tap tap) {
try {
Hfs hfs;
if (tap instanceof CompositeTap)
hfs = (Hfs) ((CompositeTap) tap).getChildTaps().next();
else
hfs = (Hfs) tap;
List<Footer> footers = getFooters(flowProcess, hfs);
if (footers.isEmpty()) {
throw new TapException("Could not read Parquet metadata at " + hfs.getPath());
} else {
return footers.get(0).getParquetMetadata().getFileMetaData().getSchema();
}
} catch (IOException e) {
throw new TapException(e);
}
}
Aggregations