@Override protected void doHadoopWork() throws BuildException { Tuple tuple = ContextManager.getCurrentTuple(); if (tuple == null) { throw new BuildException( this.getTaskName() + " should be put inside task container which provides tuple to execution context"); } try { if (tuple.getType(fieldNumber) != DataType.TUPLE || !(tuple.get(fieldNumber) instanceof Tuple)) { throw new BuildException("Tuple field " + fieldNumber + " doesn't represent a Tuple"); } ContextManager.setCurrentTupleContext((Tuple) tuple.get(fieldNumber)); try { for (Task task : tasks) { task.perform(); } } finally { ContextManager.resetCurrentTupleContext(); } } catch (ExecException e) { throw new BuildException("Failed to check type of tuple field " + fieldNumber, e); } }
@Override public void doWork() throws BuildException { Object[] array = (Object[]) this.getReference(arrayRef); for (Object obj : array) { if (property != null) { this.setPropertyThreadSafe(property, obj == null ? null : obj.toString()); } if (reference != null) { this.setReference(reference, obj); } for (Task task : tasks) { task.perform(); } } }
@Override public void doWork() throws BuildException { DescribeVpnGatewaysRequest request = new DescribeVpnGatewaysRequest(); if (gatewayIds != null) { request.setVpnGatewayIds(CollectionsHelper.asList(gatewayIds)); } if (filters != null) { request.setFilters(filters); } DescribeVpnGatewaysResult result = getEc2Client().describeVpnGateways(request); for (VpnGateway gateway : result.getVpnGateways()) { this.setPropertyThreadSafe(property, gateway.toString()); for (Task task : tasks) { task.perform(); } } }