本文整理了Java中cascading.tap.Tap.isTemporary()
方法的一些代码示例,展示了Tap.isTemporary()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tap.isTemporary()
方法的具体详情如下:
包路径:cascading.tap.Tap
类名称:Tap
方法名:isTemporary
[英]Method isTemporary returns true if this Tap is temporary (used for intermediate results).
[中]如果此点击是临时的(用于中间结果),则方法isTemporary返回true。
代码示例来源:origin: cwensel/cascading
@Override
public boolean isTemporary()
{
return original.isTemporary();
}
代码示例来源:origin: cwensel/cascading
@Override
public boolean isTemporary()
{
return original.isTemporary();
}
代码示例来源:origin: cwensel/cascading
public String makeFlowStepName( FlowStep flowStep, int numSteps, int stepNum )
{
Tap sink = Util.getFirst( flowStep.getSinkTaps() );
stepNum++; // number more sensical (5/5)
if( sink == null || sink.isTemporary() )
return String.format( "(%d/%d)", stepNum, numSteps );
String identifier = sink.getIdentifier();
if( Util.isEmpty( identifier ) )
return String.format( "(%d/%d)", stepNum, numSteps );
if( identifier.length() > 25 )
identifier = String.format( "...%25s", identifier.substring( identifier.length() - 25 ) );
return String.format( "(%d/%d) %s", stepNum, numSteps, identifier );
}
代码示例来源:origin: LiveRamp/cascading_ext
private static String getPrettyNameForTap(Tap tap, boolean removeRandomSuffixFromTempTaps) {
String id = tap.getIdentifier();
if (id == null) {
id = "null";
}
final String[] tokens = id.split("/");
// use the last token as the pretty name (works well for things that
// are paths and doesn't break things that are not)
String prettyName = tokens[tokens.length - 1];
// For temporary sources, we don't care about the random suffix appended by cascading
if (tap.isTemporary() && removeRandomSuffixFromTempTaps) {
prettyName = getCanonicalName(prettyName);
}
if (prettyName.matches("^\\d+$")) {
// For versioned stores, return "store_name/version_number", instead of just "version_number"
if (tokens.length > 1) {
return tokens[tokens.length - 2] + "/" + prettyName;
} else {
return prettyName;
}
} else {
return prettyName;
}
}
代码示例来源:origin: cwensel/cascading
/**
* Returns a Set as a given tap may be bound to multiple branches
*
* @param duct
* @return
*/
private Set<String> getTapBranchNamesFor( Duct duct )
{
if( ( (Tap) ( (ElementDuct) duct ).getFlowElement() ).isTemporary() )
return Collections.emptySet();
if( duct instanceof SourceStage )
return node.getSourceTapNames( (Tap) ( (SourceStage) duct ).getFlowElement() );
else if( duct instanceof SinkStage )
return node.getSinkTapNames( (Tap) ( (SinkStage) duct ).getFlowElement() );
else
throw new IllegalStateException( "duct does not wrap a Tap: " + duct.getClass().getCanonicalName() );
}
代码示例来源:origin: cascading/cascading-hadoop2-mr1
protected void cleanIntermediateData( JobConf config, Tap sink )
{
if( sink.isTemporary() && ( getFlow().getFlowStats().isSuccessful() || getFlow().getRunID() == null ) )
{
try
{
sink.deleteResource( config );
}
catch( Exception exception )
{
// sink all exceptions, don't fail app
logWarn( "unable to remove temporary file: " + sink, exception );
}
}
else
{
cleanTapMetaData( config, sink );
}
}
代码示例来源:origin: cwensel/cascading
protected void cleanIntermediateData( JobConf config, Tap sink )
{
if( sink.isTemporary() && ( getFlow().getFlowStats().isSuccessful() || getFlow().getRunID() == null ) )
{
try
{
sink.deleteResource( config );
}
catch( Exception exception )
{
// sink all exceptions, don't fail app
logWarn( "unable to remove temporary file: " + sink, exception );
}
}
else
{
cleanTapMetaData( config, sink );
}
}
代码示例来源:origin: cwensel/cascading
@Override
public void clean( TezConfiguration config )
{
for( Tap sink : getSinkTaps() )
{
if( sink.isTemporary() && ( getFlow().getFlowStats().isSuccessful() || getFlow().getRunID() == null ) )
{
try
{
sink.deleteResource( config );
}
catch( Exception exception )
{
// sink all exceptions, don't fail app
logWarn( "unable to remove temporary file: " + sink, exception );
}
}
else
{
cleanTapMetaData( config, sink );
}
}
for( Tap tap : getTraps() )
cleanTapMetaData( config, tap );
}
代码示例来源:origin: cascading/cascading-hadoop2-tez
@Override
public void clean( TezConfiguration config )
{
for( Tap sink : getSinkTaps() )
{
if( sink.isTemporary() && ( getFlow().getFlowStats().isSuccessful() || getFlow().getRunID() == null ) )
{
try
{
sink.deleteResource( config );
}
catch( Exception exception )
{
// sink all exceptions, don't fail app
logWarn( "unable to remove temporary file: " + sink, exception );
}
}
else
{
cleanTapMetaData( config, sink );
}
}
for( Tap tap : getTraps() )
cleanTapMetaData( config, tap );
}
内容来源于网络,如有侵权,请联系作者删除!