com.emc.mongoose.base.item.op.token.TokenOperationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongoose-base Show documentation
Show all versions of mongoose-base Show documentation
Mongoose is a high-load storage performance testing tool
package com.emc.mongoose.base.item.op.token;
import static java.lang.System.nanoTime;
import com.emc.mongoose.base.item.TokenItem;
import com.emc.mongoose.base.item.op.OpType;
import com.emc.mongoose.base.item.op.OperationImpl;
import com.emc.mongoose.base.storage.Credential;
/** Created by kurila on 20.10.15. */
public class TokenOperationImpl extends OperationImpl
implements TokenOperation {
protected volatile long countBytesDone;
protected volatile long respDataTimeStart;
public TokenOperationImpl() {}
public TokenOperationImpl(
final int originIndex, final OpType opType, final I item, final Credential credential) {
super(originIndex, opType, item, null, null, credential);
}
protected TokenOperationImpl(final TokenOperationImpl other) {
super(other);
this.countBytesDone = other.countBytesDone;
this.respDataTimeStart = other.respDataTimeStart;
}
@Override
@SuppressWarnings("unchecked")
public TokenOperationImpl result() {
return new TokenOperationImpl<>(this);
}
@Override
public long countBytesDone() {
return countBytesDone;
}
@Override
public void countBytesDone(final long n) {
this.countBytesDone = n;
}
@Override
public long respDataTimeStart() {
return respDataTimeStart;
}
@Override
public void startDataResponse() {
respDataTimeStart = START_OFFSET_MICROS + nanoTime() / 1000;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy