实现写逻辑<br>
当收到写出准备就绪的信号后，回调此方法，用户可向客户端发送消息

@param datas 发送的数据
329403
public NioClient write(ByteBuffer... datas) {
		try {
			this.channel.write(datas);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
		return this;
	}
980502
public void setDataPoints(java.util.Collection<DataPoint> dataPoints) {
        if (dataPoints == null) {
            this.dataPoints = null;
            return;
        }

        this.dataPoints = new java.util.ArrayList<DataPoint>(dataPoints);
    }
953602
public void addDatatypes(ParaObject... objects) {
		// register a new data type
		if (objects != null && objects.length > 0) {
			for (ParaObject obj : objects) {
				if (obj != null && obj.getType() != null) {
					addDatatype(obj.getPlural(), obj.getType());
				}
			}
		}
	}
925203
public void writeToExcel(List<? extends Object> datas, boolean hasTitle,
                             OutputStream outputStream, int inMemory,
                             boolean transverse) throws IOException {
        log.info("准备将数据写入excel");
        //这里使用SXSSFWorkbook而不是XSSFWorkbook，这样将会节省内存，但是内存中仅仅存在inMemory行数据，如果超出那么会将
        //index最小的刷新到本地，后续不能通过getRow方法获取到该行
        SXSSFWorkbook wb = new SXSSFWorkbook(inMemory);
        writeToExcel(datas, hasTitle, wb, transverse);
        log.info("数据写入excel完毕，准备写入本地文件");
        wb.write(outputStream);
        log.debug("删除临时文件，关闭Workbook");
        wb.dispose();
        wb.close();
    }
26050
public void fit(Map<Object, URI> datasets) {
        TrainingParameters tp = (TrainingParameters) knowledgeBase.getTrainingParameters();
        Dataframe trainingData = Dataframe.Builder.parseTextFiles(datasets,
                AbstractTextExtractor.newInstance(tp.getTextExtractorParameters()),
                knowledgeBase.getConfiguration()
        );
        
        fit(trainingData);
        
        trainingData.close();
    }
1170932
public boolean buildData(String[] data) {
        final int length = data.length;

        for (int i = 0; i < length; i++) {
            addAddressToList(data[i]);
        }

        return true;
    }
866449
public void handleData(String data) {
		try {
			sendEvent(new ClickEvent(this.user, getPayload()));
			if (clickHandler != null)
				clickHandler.clicked();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
256118
public Workbook writeToExcel(List<? extends Object> datas, boolean hasTitle, Workbook workbook,
                                 boolean transverse) {
        if (CollectionUtil.safeIsEmpty(datas)) {
            log.warn("给定数据集合为空");
            return workbook;
        }
        datas = datas.parallelStream().filter(data -> data != null).collect(Collectors.toList());
        if (datas.isEmpty()) {
            log.warn("给定数据集合里的数据全是空");
            return workbook;
        }
        //获取所有字段（包括父类的）
        Field[] fields = ReflectUtil.getAllFields(datas.get(0).getClass());

        log.info("获取可写入excel的字段");
        List<Field> writeFields = new ArrayList<>();
        for (Field field : fields) {
            String name = field.getName();
            log.debug("检查字段[{}]是否可以写入", name);
            Class<?> type = field.getType();

            List<ExcelDataWriter<?>> data = writers.values().stream()
                .filter(excelData -> excelData.writeable(type)).collect(Collectors.toList());
            if (data.isEmpty()) {
                log.info("字段[{}]不能写入", name);
            } else {
                log.info("字段[{}]可以写入excel");
                ExcelColumn column = field.getAnnotation(ExcelColumn.class);

                if (column == null || !column.ignore()) {
                    writeFields.add(field);
                }
            }
        }
        log.debug("可写入excel的字段集合为：[{}]", writeFields);
        log.debug("对可写入excel的字段集合排序");

        Collections.sort(writeFields, COMPARATOR);

        log.debug("可写入excel的字段集合排序完毕，构建标题列表");

        List<Writer<?>> titles = null;
        if (hasTitle) {
            log.info("当前需要标题列表，构建...");
            titles = new ArrayList<>(writeFields.size());
            for (int i = 0; i < writeFields.size(); i++) {
                Field field = writeFields.get(i);
                ExcelColumn column = field.getAnnotation(ExcelColumn.class);
                if (column == null || StringUtils.isEmpty(column.value())) {
                    titles.add(build(field.getName()));
                } else {
                    titles.add(build(column.value()));
                }
            }
        }

        log.debug("构建单元格数据");
        List<List<Writer<?>>> writeDatas = new ArrayList<>(datas.size());
        for (int i = 0; i < datas.size(); i++) {
            Object dataValue = datas.get(i);
            //构建一行数据
            List<Writer<?>> columnDatas = new ArrayList<>(writeFields.size());
            //加入
            writeDatas.add(columnDatas);
            for (int j = 0; j < writeFields.size(); j++) {
                Field field = writeFields.get(j);
                try {
                    log.debug("获取[{}]中字段[{}]的值", dataValue, field.getName());
                    Object value = field.get(dataValue);
                    columnDatas.add(build(value));
                } catch (IllegalAccessException e) {
                    log.warn("[{}]中字段[{}]不能读取", dataValue, field.getName(), e);
                    columnDatas.add(null);
                }
            }
        }

        log.debug("要写入的数据为：[{}]", writeDatas);
        log.info("准备写入数据");
        writeToExcel(titles, writeDatas, hasTitle, workbook, transverse);
        log.info("标题列表为：[{}]", titles);
        return workbook;
    }
423572
public Result<Void> writeDataPoints(Series series, List<DataPoint> data) {
    checkNotNull(series);
    checkNotNull(data);

    URI uri = null;
    try {
      URIBuilder builder = new URIBuilder(String.format("/%s/series/key/%s/data/", API_VERSION, urlencode(series.getKey())));
      uri = builder.build();
    } catch (URISyntaxException e) {
      String message = String.format("Could not build URI with inputs: key: %s", series.getKey());
      throw new IllegalArgumentException(message, e);
    }

    Result<Void> result = null;
    String body = null;
    try{
      body = Json.dumps(data);
    } catch (JsonProcessingException e) {
      String message = "Error serializing the body of the request. More detail: " + e.getMessage();
      result = new Result<Void>(null, GENERIC_ERROR_CODE, message);
      return result;
    }

    HttpRequest request = buildRequest(uri.toString(), HttpMethod.POST, body);
    result = execute(request, Void.class);
    return result;
  }
269139
def setDatasets(self, datasets):
        
        self.clearDatasets()
        self._datasets = datasets
        
        for dataset in datasets:
            self._addDatasetAction(dataset)
        
        self._dataChanged = True
        self.recalculate()
448274
public void setData(byte[] data) {
        if (immutable) {
            throw new IllegalStateException(ERR_MSG_IMMUTABLE);
        }
        if (data == null) {
            this.data = null;
        } else {
            setData(data, 0, data.length);
        }
    }
529170
public AbstractExcelWriter<T> write(List<T> datas) throws WriteExcelException {
        this.initWrite(datas);
        this.validateDataPerWrite();
        for (T data : this.datas) {
            this.writePerData(data);
        }
        this.datas.clear();
        return this;
    }
1106096
private static byte[] sha256(String datas, String encoding) {
		try {
			return sha256(datas.getBytes(encoding));
		} catch (UnsupportedEncodingException e) {
			LogUtil.writeErrorLog("SHA256计算失败", e);
			return null;
		}
	}
143423
public void setQueries(java.util.Collection<QueryInfo> queries) {
        if (queries == null) {
            this.queries = null;
            return;
        }

        this.queries = new com.amazonaws.internal.SdkInternalList<QueryInfo>(queries);
    }
539631
private void display(ResultSet rows) {

    final int width1 = 38;
    final int width2 = 12;
    final int width3 = 30;
    final int width4 = 21;

    String format = "%-" + width1 + "s%-" + width2 + "s%-" + width3 + "s%-" + width4 + "s%n";

    // headings
    System.out.printf(format, "sensor_id", "date", "timestamp", "value");

    // separators
    drawLine(width1, width2, width3, width4);

    // data
    for (Row row : rows) {

      System.out.printf(
          format,
          row.getUuid("sensor_id"),
          row.getLocalDate("date"),
          row.getInstant("timestamp"),
          row.getDouble("value"));
    }
  }
1299650
public final void setDatas(@NonNull Iterable<? extends Data<?>> datas) {
        checkNotNull(datas, "datas");
        mDatas.clear();

        for (Data<?> data : datas) {
            mDatas.add(data);
            // Add entry for each new data instance in our registration map.
            if (!mRegistered.containsKey(data)) {
                mRegistered.put(data, false);
            }
        }

        // Remove and unregister any entries in our registration map that aren't in the new set.
        Iterator<Map.Entry<Data<?>, Boolean>> it = mRegistered.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<Data<?>, Boolean> entry = it.next();
            Data<?> data = entry.getKey();
            Boolean registered = entry.getValue();
            if (!mDatas.contains(data) && registered) {
                data.unregisterDataObserver(mDataObserver);
                data.unregisterLoadingObserver(mLoadingObserver);
                data.unregisterErrorObserver(mErrorObserver);
                it.remove();
            }
        }

        updateRegistration();
    }
777338
public void setData(byte[] data) {
        byte[] copy = new byte[data.length];
        System.arraycopy(data, 0, copy, 0, data.length);
        this.data = copy;
    }