Cleanup of javadocs

This commit is contained in:
Ziver Koc 2020-10-02 00:49:47 +02:00
parent c8f382a4eb
commit 8cdd25b262
8 changed files with 133 additions and 118 deletions

View file

@ -33,6 +33,8 @@ public class LevenshteinDistance {
* Calculates the Levenshtein Distance(Number of character * Calculates the Levenshtein Distance(Number of character
* changes to equalize the two strings) for two Strings. * changes to equalize the two strings) for two Strings.
* *
* @param str1 first String to be compared
* @param str2 second string to be compared
* @return The number of changes needed to equalize the two Strings * @return The number of changes needed to equalize the two Strings
*/ */
public static int getDistance(String str1, String str2) { public static int getDistance(String str1, String str2) {
@ -44,6 +46,8 @@ public class LevenshteinDistance {
* Calculates the Levenshtein Distance(Number of character * Calculates the Levenshtein Distance(Number of character
* changes to equalize the two strings) for two Strings. * changes to equalize the two strings) for two Strings.
* *
* @param str1 first String to be compared
* @param str2 second string to be compared
* @param matrix is a int matrix that will be used for the dynamic programing algorithm. * @param matrix is a int matrix that will be used for the dynamic programing algorithm.
* NOTE: matrix must be 1 larger than the largest string * NOTE: matrix must be 1 larger than the largest string
* @return The number of changes needed to equalize the two Strings * @return The number of changes needed to equalize the two Strings

View file

@ -60,6 +60,7 @@ public abstract class AbstractChart extends JPanel{
* *
* @param g2 is the Graphics object that will paint the chart * @param g2 is the Graphics object that will paint the chart
* @param bound is the bounds of the axis, the drawing should not exceed this bound * @param bound is the bounds of the axis, the drawing should not exceed this bound
* @return a Rectangle object specifying the drawn are of the axis
*/ */
protected abstract Rectangle drawAxis(Graphics2D g2, Rectangle bound); protected abstract Rectangle drawAxis(Graphics2D g2, Rectangle bound);

View file

@ -36,8 +36,8 @@ import java.util.TimerTask;
* *
* @author Ziver * @author Ziver
*/ */
public class DBConnectionPool extends TimerTask implements Closeable{ public class DBConnectionPool extends TimerTask implements Closeable {
public static final long DEFAULT_TIMEOUT = 10*60*60*1000; // 10 minutes; public static final long DEFAULT_TIMEOUT = 10 * 60 * 60 * 1000; // 10 minutes;
public static final int DEFAULT_MAX_SIZE = 5; public static final int DEFAULT_MAX_SIZE = 5;
// DB details // DB details
@ -52,26 +52,26 @@ public class DBConnectionPool extends TimerTask implements Closeable{
private long timeout; private long timeout;
private Timer timeout_timer; private Timer timeout_timer;
protected class PoolItem{ protected class PoolItem {
public DBConnection conn; public DBConnection conn;
public long timestamp; public long timestamp;
public boolean equals(Object o){ public boolean equals(Object o) {
return conn.equals(o); return conn.equals(o);
} }
} }
// The pool // The pool
private LinkedList<PoolItem> inusePool; private LinkedList<PoolItem> inUsePool;
private LinkedList<PoolItem> readyPool; private LinkedList<PoolItem> readyPool;
/** /**
* Creates a new pool of DB connections * Creates a new pool of DB connections
* *
* @param dbms is the DB type * @param dbms is the DB type
* @param url is the URL to the DB * @param url is the URL to the DB
* @param db is the name of the database * @param db is the name of the database
* @param user is the user name to the DB * @param user is the user name to the DB
* @param password is the password to the DB * @param password is the password to the DB
*/ */
public DBConnectionPool(DBMS dbms, String url, String db, String user, String password) { public DBConnectionPool(DBMS dbms, String url, String db, String user, String password) {
@ -81,7 +81,7 @@ public class DBConnectionPool extends TimerTask implements Closeable{
this.user = user; this.user = user;
this.password = password; this.password = password;
inusePool = new LinkedList<>(); inUsePool = new LinkedList<>();
readyPool = new LinkedList<>(); readyPool = new LinkedList<>();
this.setTimeout(DEFAULT_TIMEOUT); this.setTimeout(DEFAULT_TIMEOUT);
@ -93,7 +93,7 @@ public class DBConnectionPool extends TimerTask implements Closeable{
* *
* @param conn is the Connection to register * @param conn is the Connection to register
*/ */
protected void addConnection(DBConnection conn){ protected void addConnection(DBConnection conn) {
PoolItem item = new PoolItem(); PoolItem item = new PoolItem();
item.conn = conn; item.conn = conn;
readyPool.addLast(item); readyPool.addLast(item);
@ -104,8 +104,8 @@ public class DBConnectionPool extends TimerTask implements Closeable{
* *
* @param conn is the connection to remove * @param conn is the connection to remove
*/ */
protected void removeConnection(DBConnection conn){ protected void removeConnection(DBConnection conn) {
inusePool.remove(conn); inUsePool.remove(conn);
readyPool.remove(conn); readyPool.remove(conn);
} }
@ -113,20 +113,20 @@ public class DBConnectionPool extends TimerTask implements Closeable{
* Lease one connection from the pool * Lease one connection from the pool
* *
* @return an DB connection or null if the pool is empty * @return an DB connection or null if the pool is empty
* @throws Exception will be thrown if there is any issue instantiating a DBConnection
*/ */
public synchronized DBConnection getConnection() throws Exception{ public synchronized DBConnection getConnection() throws Exception {
if(readyPool.isEmpty()){ if (readyPool.isEmpty()) {
if( size() < max_conn ){ if (size() < max_conn) {
DBConnection conn = new DBConnection(dbms, url, db, user, password); DBConnection conn = new DBConnection(dbms, url, db, user, password);
conn.setPool( this ); conn.setPool(this);
addConnection( conn ); addConnection(conn);
return conn; return conn;
} }
return null; return null;
} } else {
else{
PoolItem item = readyPool.poll(); PoolItem item = readyPool.poll();
inusePool.addLast(item); inUsePool.addLast(item);
item.timestamp = System.currentTimeMillis(); item.timestamp = System.currentTimeMillis();
return item.conn; return item.conn;
} }
@ -137,28 +137,29 @@ public class DBConnectionPool extends TimerTask implements Closeable{
* *
* @param conn is the connection that is not used anymore * @param conn is the connection that is not used anymore
*/ */
protected synchronized void releaseConnection(DBConnection conn){ protected synchronized void releaseConnection(DBConnection conn) {
int index = inusePool.indexOf(conn); int index = inUsePool.indexOf(conn);
PoolItem item = inusePool.remove(index); PoolItem item = inUsePool.remove(index);
readyPool.addLast(item); readyPool.addLast(item);
} }
/** /**
* @return the current size of the pool * @return the current size of the pool
*/ */
public int size(){ public int size() {
return inusePool.size() + readyPool.size(); return inUsePool.size() + readyPool.size();
} }
/** /**
* Closes all the connections * Closes all the connections
*/ */
public synchronized void close(){ public synchronized void close() {
for( PoolItem item : inusePool ){ for (PoolItem item : inUsePool) {
item.conn.forceClose(); item.conn.forceClose();
} }
inusePool.clear(); inUsePool.clear();
for( PoolItem item : readyPool ){
for (PoolItem item : readyPool) {
item.conn.forceClose(); item.conn.forceClose();
} }
readyPool.clear(); readyPool.clear();
@ -166,17 +167,22 @@ public class DBConnectionPool extends TimerTask implements Closeable{
/** /**
* Set the max size of the pool * Set the max size of the pool
*
* @param max the new maximum size of the pool
*/ */
public void setMaxSize(int max){ public void setMaxSize(int max) {
this.max_conn = max; this.max_conn = max;
} }
/** /**
* Sets the timeout of the Connections * Sets the timeout of the Connections
*
* @param timeout the new timeout value in milliseconds
*/ */
public synchronized void setTimeout(long timeout){ public synchronized void setTimeout(long timeout) {
this.timeout = timeout; this.timeout = timeout;
if(timeout_timer!=null)
if (timeout_timer != null)
timeout_timer.cancel(); timeout_timer.cancel();
timeout_timer = new Timer(); timeout_timer = new Timer();
timeout_timer.schedule(this, 0, timeout / 2); timeout_timer.schedule(this, 0, timeout / 2);
@ -185,11 +191,11 @@ public class DBConnectionPool extends TimerTask implements Closeable{
/** /**
* Checks every DB connection if they are valid and has not timed out * Checks every DB connection if they are valid and has not timed out
*/ */
public void run(){ public void run() {
long stale = System.currentTimeMillis() - timeout; long stale = System.currentTimeMillis() - timeout;
for(PoolItem item : inusePool){ for (PoolItem item : inUsePool) {
if( !item.conn.valid() && stale > item.timestamp ) { if (!item.conn.valid() && stale > item.timestamp) {
removeConnection(item.conn); removeConnection(item.conn);
item.conn.forceClose(); item.conn.forceClose();
} }

View file

@ -34,6 +34,8 @@ public interface SQLResultHandler<T> {
* *
* @param stmt is the query * @param stmt is the query
* @param result is the ResultSet * @param result is the ResultSet
* @return a value based on the result handler description
* @throws SQLException if there is any database related issues
*/ */
T handleQueryResult(Statement stmt, ResultSet result) throws SQLException; T handleQueryResult(Statement stmt, ResultSet result) throws SQLException;
} }

View file

@ -10,13 +10,12 @@ import java.sql.SQLException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
* A intermediate class for loading Objects of generic Classes. * A intermediate class for loading Objects of generic Classes.
* The extending class must set the "superBean" parameter to true in {@link DBBean.DBTable}. * The extending class must set the "superBean" parameter to true in {@link DBBean.DBTable}.
* The Object that is stored must use Configurator to define what fields that should be stored. * The Object that is stored must use Configurator to define what fields that should be stored.
* *
* This class needs to fields in DB: * This class needs two fields in DB:
* <ul> * <ul>
* <li>String type: defining the class name</li> * <li>String type: defining the class name</li>
* <li>Text config: the object configuration is stored as JSON</li> * <li>Text config: the object configuration is stored as JSON</li>
@ -74,6 +73,8 @@ public abstract class DBBeanObjectDSO<T> extends DBBean{
/** /**
* Will replace the current object. * Will replace the current object.
*
* @param obj is the object to set or null to reset the DSO
*/ */
public void setObject(T obj){ public void setObject(T obj){
if(obj != null) { if(obj != null) {

View file

@ -39,7 +39,7 @@ import java.util.List;
import java.util.logging.Logger; import java.util.logging.Logger;
public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T> {
private static final Logger logger = LogUtil.getLogger(); private static final Logger logger = LogUtil.getLogger();
private Class<? extends DBBean> beanClass; private Class<? extends DBBean> beanClass;
@ -48,46 +48,49 @@ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{
private boolean list; private boolean list;
/** /**
* Creates a new instance of this class that returns only one bean * Creates a new instance of this class that returns only one bean
* *
* @param cl is the DBBean class that will be parsed from the SQL result * @param <C> is the class type that should be instantiated
* @return a new instance of this class * @param cl is the DBBean class that will be parsed from the SQL result
* @return a new instance of this class
*/ */
public static <C extends DBBean> DBBeanSQLResultHandler<C> create(Class<C> cl){ public static <C extends DBBean> DBBeanSQLResultHandler<C> create(Class<C> cl) {
return new DBBeanSQLResultHandler<>(cl, null, false); return new DBBeanSQLResultHandler<>(cl, null, false);
} }
/** /**
* Creates a new instance of this class that returns a bean with all its containing beans * Creates a new instance of this class that returns a bean with all its containing beans
* *
* @param cl is the DBBean class that will be parsed from the SQL result * @param <C> is the class type that should be instantiated
* @param db is the DB connection for loading internal beans * @param cl is the DBBean class that will be parsed from the SQL result
* @return a new instance of this class * @param db is the DB connection for loading internal beans
* @return a new instance of this class
*/ */
public static <C extends DBBean> DBBeanSQLResultHandler<C> create(Class<C> cl, DBConnection db){ public static <C extends DBBean> DBBeanSQLResultHandler<C> create(Class<C> cl, DBConnection db) {
return new DBBeanSQLResultHandler<>(cl, db, false); return new DBBeanSQLResultHandler<>(cl, db, false);
} }
/** /**
* Creates a new instance of this class that returns a list of beans * Creates a new instance of this class that returns a list of beans
* *
* @param cl is the DBBean class that will be parsed from the SQL result * @param <C> is the class type that should be instantiated
* @return a new instance of this class * @param cl is the DBBean class that will be parsed from the SQL result
* @return a new instance of this class
*/ */
public static <C extends DBBean> DBBeanSQLResultHandler<List<C>> createList(Class<C> cl){ public static <C extends DBBean> DBBeanSQLResultHandler<List<C>> createList(Class<C> cl) {
return new DBBeanSQLResultHandler<>(cl, null, true); return new DBBeanSQLResultHandler<>(cl, null, true);
} }
/** /**
* Creates a new instance of this class that returns a list of beans with all the internal beans * Creates a new instance of this class that returns a list of beans with all the internal beans
* *
* @param cl is the DBBean class that will be parsed from the SQL result * @param <C> is the class type that should be instantiated
* @param db is the DB connection for loading internal beans * @param cl is the DBBean class that will be parsed from the SQL result
* @return a new instance of this class * @param db is the DB connection for loading internal beans
* @return a new instance of this class
*/ */
public static <C extends DBBean> DBBeanSQLResultHandler<List<C>> createList(Class<C> cl, DBConnection db){ public static <C extends DBBean> DBBeanSQLResultHandler<List<C>> createList(Class<C> cl, DBConnection db) {
return new DBBeanSQLResultHandler<>(cl, db, true); return new DBBeanSQLResultHandler<>(cl, db, true);
} }
@ -95,36 +98,35 @@ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{
/** /**
* Creates a new instance of this class * Creates a new instance of this class
* *
* @param cl is the DBBean class that will be parsed from the SQL result * @param cl is the DBBean class that will be parsed from the SQL result
* @param db is the DB connection for loading internal beans, may be null to disable internal beans * @param db is the DB connection for loading internal beans, may be null to disable internal beans
* @param list is if the handler should return a list of beans instead of one * @param list is if the handler should return a list of beans instead of one
*/ */
protected DBBeanSQLResultHandler(Class<? extends DBBean> cl, DBConnection db, boolean list) { protected DBBeanSQLResultHandler(Class<? extends DBBean> cl, DBConnection db, boolean list) {
this.beanClass = cl; this.beanClass = cl;
this.list = list; this.list = list;
this.db = db; this.db = db;
this.beanConfig = DBBeanConfig.getBeanConfig( cl ); this.beanConfig = DBBeanConfig.getBeanConfig(cl);
} }
/** /**
* Is called to handle a result from a query. * Is called to handle a result from a query.
* *
* @param stmt is the query * @param stmt is the query
* @param result is the ResultSet * @param result is the ResultSet
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public T handleQueryResult(Statement stmt, ResultSet result) throws SQLException{ public T handleQueryResult(Statement stmt, ResultSet result) throws SQLException {
if( list ){ if (list) {
List<DBBean> bean_list = new LinkedList<>(); List<DBBean> bean_list = new LinkedList<>();
while( result.next() ){ while (result.next()) {
DBBean obj = createBean(result); DBBean obj = createBean(result);
bean_list.add( obj ); bean_list.add(obj);
} }
return (T) bean_list; return (T) bean_list;
} } else {
else{ if (result.next()) {
if( result.next() ){
return (T) createBean(result); return (T) createBean(result);
} }
return null; return null;
@ -136,22 +138,21 @@ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{
/** /**
* Instantiates a new bean and assigns field values from the ResultSet * Instantiates a new bean and assigns field values from the ResultSet
* *
* @param result is where the field values for the bean will bee read from, the cursor should be in front of the data * @param result is where the field values for the bean will bee read from, the cursor should be in front of the data
* @return a new instance of the bean * @return a new instance of the bean
*/ */
private DBBean createBean(ResultSet result) throws SQLException{ private DBBean createBean(ResultSet result) throws SQLException {
try { try {
Long id = result.getLong( "id" ); Long id = result.getLong("id");
// Check cache first // Check cache first
DBBean obj = DBBeanCache.get(beanClass, id); DBBean obj = DBBeanCache.get(beanClass, id);
if ( obj == null ) { if (obj == null) {
// Cache miss create a new bean // Cache miss create a new bean
logger.fine("Creating new Bean(" + beanClass.getName() + ") with id: " + id); logger.fine("Creating new Bean(" + beanClass.getName() + ") with id: " + id);
obj = beanClass.newInstance(); obj = beanClass.newInstance();
obj.setId(id); obj.setId(id);
updateBean( result, obj ); updateBean(result, obj);
} } else if (DBBeanCache.isOutDated(obj)) {
else if (DBBeanCache.isOutDated(obj)){
// Update fields // Update fields
logger.finer("Bean(" + beanClass.getName() + ") cache to old for id: " + id); logger.finer("Bean(" + beanClass.getName() + ") cache to old for id: " + id);
updateBean(result, obj); updateBean(result, obj);
@ -167,14 +168,14 @@ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{
/** /**
* Updates an existing bean and assigns field values from the ResultSet * Updates an existing bean and assigns field values from the ResultSet
* *
* @param result is where the field values for the bean will be read from, the cursor should be in front of the data * @param result is where the field values for the bean will be read from, the cursor should be in front of the data
* @param obj is the bean that will be updated * @param obj is the bean that will be updated
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void updateBean(ResultSet result, DBBean obj) throws SQLException{ private void updateBean(ResultSet result, DBBean obj) throws SQLException {
if (obj.readLock.tryLock()) { if (obj.readLock.tryLock()) {
try { try {
logger.fine("Updating Bean("+ beanClass.getName() +") with id: "+ obj.getId()); logger.fine("Updating Bean(" + beanClass.getName() + ") with id: " + obj.getId());
// Read fields // Read fields
for (DBBeanFieldConfig field : beanConfig.getFields()) { for (DBBeanFieldConfig field : beanConfig.getFields()) {
String name = field.getName(); String name = field.getName();
@ -204,11 +205,11 @@ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{
DBBeanConfig subBeanConfig = subBeanField.getSubBeanConfig(); DBBeanConfig subBeanConfig = subBeanField.getSubBeanConfig();
// Load List from link table // Load List from link table
String subSql = "SELECT subBeanTable.* FROM "+ String subSql = "SELECT subBeanTable.* FROM " +
subBeanField.getLinkTableName() +" as linkTable, "+ subBeanField.getLinkTableName() + " as linkTable, " +
subBeanConfig.getTableName() +" as subBeanTable " + subBeanConfig.getTableName() + " as subBeanTable " +
"WHERE linkTable."+subBeanField.getParentIdColumnName()+"=? AND " + "WHERE linkTable." + subBeanField.getParentIdColumnName() + "=? AND " +
"linkTable."+subBeanConfig.getIdColumnName()+"=subBeanTable."+subBeanConfig.getIdColumnName(); "linkTable." + subBeanConfig.getIdColumnName() + "=subBeanTable." + subBeanConfig.getIdColumnName();
logger.finest("List Load Query: " + subSql); logger.finest("List Load Query: " + subSql);
PreparedStatement subStmt = db.getPreparedStatement(subSql); PreparedStatement subStmt = db.getPreparedStatement(subSql);
subStmt.setObject(1, obj.getId()); subStmt.setObject(1, obj.getId());

View file

@ -49,6 +49,8 @@ public class ThreadedUDPNetwork extends Thread{
/** /**
* Creates a new unicast Client instance of the class * Creates a new unicast Client instance of the class
*
* @throws SocketException if there is any issue creating the new socket
*/ */
public ThreadedUDPNetwork() throws SocketException{ public ThreadedUDPNetwork() throws SocketException{
this.type = UDPType.UNICAST; this.type = UDPType.UNICAST;
@ -61,6 +63,7 @@ public class ThreadedUDPNetwork extends Thread{
* Creates a new unicast Server instance of the class * Creates a new unicast Server instance of the class
* *
* @param port is the port that the server should listen to * @param port is the port that the server should listen to
* @throws SocketException if there is any issue creating the new socket
*/ */
public ThreadedUDPNetwork(int port) throws SocketException{ public ThreadedUDPNetwork(int port) throws SocketException{
this.type = UDPType.UNICAST; this.type = UDPType.UNICAST;

View file

@ -145,89 +145,86 @@ public class ProcDiskstats {
return devName; return devName;
} }
/** /**
* This values increment when an I/O request completes. * @return number of completed I/O requests.
*/ */
public long getReadIO() { public long getReadIO() {
return readIO; return readIO;
} }
/** /**
* This value increment when an I/O request is merged with an * @return number of merged I/O requests with an already-queued I/O request.
* already-queued I/O request.
*/ */
public long getReadMerges() { public long getReadMerges() {
return readMerges; return readMerges;
} }
/** /**
* This value count the number of sectors read from to this * @return the number of sectors read from to this block device.
* block device. The "sectors" in question are the standard UNIX 512-byte * The "sectors" in question are the standard UNIX 512-byte
* sectors, not any device- or filesystem-specific block size. The * sectors, not any device- or filesystem-specific block size. The
* counter is incremented when the I/O completes. * counter is incremented when the I/O completes.
*/ */
public long getReadSectors() { public long getReadSectors() {
return readSectors; return readSectors;
} }
/** /**
* This value count the number of milliseconds that I/O requests have * @return the number of milliseconds that I/O requests have
* waited on this block device. If there are multiple I/O requests waiting, * waited on this block device. If there are multiple I/O requests waiting,
* this value will increase at a rate greater than 1000/second; for * this value will increase at a rate greater than 1000/second; for
* example, if 60 read requests wait for an average of 30 ms, the read_ticks * example, if 60 read requests wait for an average of 30 ms, the read_ticks
* field will increase by 60*30 = 1800. * field will increase by 60*30 = 1800.
*/ */
public long getReadTicks() { public long getReadTicks() {
return readTicks; return readTicks;
} }
/** /**
* This values increment when an I/O request completes. * @return number of completed I/O requests.
*/ */
public long getWriteIO() { public long getWriteIO() {
return writeIO; return writeIO;
} }
/** /**
* This value increment when an I/O request is merged with an * @return the number of merged I/O requests with an already-queued I/O request.
* already-queued I/O request.
*/ */
public long getWriteMerges() { public long getWriteMerges() {
return writeMerges; return writeMerges;
} }
/** /**
* This value count the number of sectors written to this * @return the number of sectors written to this block device.
* block device. The "sectors" in question are the standard UNIX 512-byte * The "sectors" in question are the standard UNIX 512-byte
* sectors, not any device- or filesystem-specific block size. The * sectors, not any device- or filesystem-specific block size.
* counter is incremented when the I/O completes. * The counter is incremented when the I/O completes.
*/ */
public long getWriteSectors() { public long getWriteSectors() {
return writeSectors; return writeSectors;
} }
/** /**
* This value count the number of milliseconds that I/O requests have * @return the number of milliseconds that I/O requests have
* waited on this block device. If there are multiple I/O requests waiting, * waited on this block device. If there are multiple I/O requests waiting,
* this value will increase at a rate greater than 1000/second; for * this value will increase at a rate greater than 1000/second; for
* example, if 60 write requests wait for an average of 30 ms, the write_ticks * example, if 60 write requests wait for an average of 30 ms, the write_ticks
* field will increase by 60*30 = 1800. * field will increase by 60*30 = 1800.
*/ */
public long getWriteTicks() { public long getWriteTicks() {
return writeTicks; return writeTicks;
} }
/** /**
* This value counts the number of I/O requests that have been issued to * @return the number of I/O requests that have been issued to
* the device driver but have not yet completed. It does not include I/O * the device driver but have not yet completed. It does not include I/O
* requests that are in the queue but not yet issued to the device driver. * requests that are in the queue but not yet issued to the device driver.
*/ */
public long getInFlight() { public long getInFlight() {
return inFlight; return inFlight;
} }
/** /**
* This value counts the number of milliseconds during which the device has * @return the number of milliseconds during which the device has had I/O requests queued.
* had I/O requests queued.
*/ */
public long getIoTicks() { public long getIoTicks() {
return ioTicks; return ioTicks;
} }
/** /**
* This value counts the number of milliseconds that I/O requests have waited * @return the number of milliseconds that I/O requests have waited
* on this block device. If there are multiple I/O requests waiting, this * on this block device. If there are multiple I/O requests waiting, this
* value will increase as the product of the number of milliseconds times the * value will increase as the product of the number of milliseconds times the
* number of requests waiting (see "read ticks" above for an example). * number of requests waiting (see "read ticks" above for an example).
*/ */
public long getTimeInQueue() { public long getTimeInQueue() {
return timeInQueue; return timeInQueue;