本文整理了Java中com.alibaba.datax.common.element.Record.getMemorySize
方法的一些代码示例,展示了Record.getMemorySize
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.getMemorySize
方法的具体详情如下:
包路径:com.alibaba.datax.common.element.Record
类名称:Record
方法名:getMemorySize
暂无
代码示例来源:origin: ECNU-1X/DataX-Masking
private int getRecordBytes(Collection<Record> rs){
int bytes = 0;
for(Record r : rs){
bytes += r.getMemorySize();
}
return bytes;
}
代码示例来源:origin: ECNU-1X/DataX-Masking
@Override
protected void doPush(Record r) {
try {
long startTime = System.nanoTime();
this.queue.put(r);
waitWriterTime += System.nanoTime() - startTime;
memoryBytes.addAndGet(r.getMemorySize());
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
代码示例来源:origin: ECNU-1X/DataX-Masking
@Override
protected Record doPull() {
try {
long startTime = System.nanoTime();
Record r = this.queue.take();
waitReaderTime += System.nanoTime() - startTime;
memoryBytes.addAndGet(-r.getMemorySize());
return r;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException(e);
}
}
代码示例来源:origin: ECNU-1X/DataX-Masking
@Override
public void sendToWriter(Record record) {
if(shutdown){
throw DataXException.asDataXException(CommonErrorCode.SHUT_DOWN_TASK, "");
}
Validate.notNull(record, "record不能为空.");
if (record.getMemorySize() > this.byteCapacity) {
this.pluginCollector.collectDirtyRecord(record, new Exception(String.format("单条记录超过大小限制,当前限制为:%s", this.byteCapacity)));
return;
}
boolean isFull = (this.bufferIndex >= this.bufferSize || this.memoryBytes.get() + record.getMemorySize() > this.byteCapacity);
if (isFull) {
flush();
}
this.buffer.add(record);
this.bufferIndex++;
memoryBytes.addAndGet(record.getMemorySize());
}
代码示例来源:origin: ECNU-1X/DataX-Masking
@Override
public void sendToWriter(Record record) {
if (shutdown) {
throw DataXException.asDataXException(CommonErrorCode.SHUT_DOWN_TASK, "");
}
Validate.notNull(record, "record不能为空.");
record = doTransformer(record);
if(record == null){
return;
}
if (record.getMemorySize() > this.byteCapacity) {
this.pluginCollector.collectDirtyRecord(record, new Exception(String.format("单条记录超过大小限制,当前限制为:%s", this.byteCapacity)));
return;
}
boolean isFull = (this.bufferIndex >= this.bufferSize || this.memoryBytes.get() + record.getMemorySize() > this.byteCapacity);
if (isFull) {
flush();
}
this.buffer.add(record);
this.bufferIndex++;
memoryBytes.addAndGet(record.getMemorySize());
}
代码示例来源:origin: ECNU-1X/DataX-Masking
bufferBytes += record.getMemorySize();
内容来源于网络,如有侵权,请联系作者删除!