public void run() { try { Thread ct = Thread.currentThread(); Thread.sleep(shift); while (monitor != null && monitor.equals(ct)) { long executiontime = System.currentTimeMillis(); OnMemoryTupleSet ts = new OnMemoryTupleSet(schema); Tuple t = new Tuple(schema.size()); t.setTimestamp(table[0], executiontime); t.setLong(0, executiontime); t.setString(1, command); t.setString(2, getCommandOutput()); ts.appendTuple(t); ts.beforeFirst(); deliverTupleSet(executiontime, table[0], ts); Thread.sleep(interval); } } catch (Exception e) { e.printStackTrace(); } }
protected void generateSimpleTypeClass(Schema schema, File dir) throws IOException { for (SimpleType simpleType : schema.getSimpleTypes()) { if (!typeMapper.isWellKnownType( simpleType.getSchema().getTargetNamespace(), simpleType.getName())) { generateClassFromSimpleType(schema, simpleType, dir); } } }
protected void generateComplexTypeClass(Types types, Schema schema, File dir) throws IOException { for (ComplexType complexType : schema.getComplexTypes()) { if (!typeMapper.isWellKnownType( complexType.getSchema().getTargetNamespace(), complexType.getName())) { generateClassFromComplexType(types, schema, complexType, dir); } } }
public CommandWrapper(String name) throws StreamSpinnerException { super(name); table = new String[1]; table[0] = "Command"; String[] attrs = {table[0] + ".Timestamp", table[0] + ".Name", table[0] + ".Output"}; String[] types = {DataTypes.LONG, DataTypes.STRING, DataTypes.STRING}; schema = new Schema(table[0], attrs, types); schema.setTableType(Schema.STREAM); }