public class Prefetching
extends java.lang.Thread
This class implements generic prefetching strategies but it is ready to be inherited by another class providing a more suitable interface.
Modifier and Type | Field and Description |
---|---|
protected int[] |
compressionSlopeThresholds
Definition in
WindowScalingFactor.compressionSlopeThresholds . |
protected boolean |
finish
Indicates whether the thread has to finish.
|
protected CADILog |
log
It is an object that will be used to log processes.
|
private float |
maxProbMovements |
protected Movements |
movements |
protected static int |
NUM_SLOPE_THRESHOLDS
Number of resequenced quality layers.
|
protected int |
prefetchingWOIType |
protected PrefSemaphore |
prefSemaphore |
protected boolean |
recomputeWOI |
private java.util.HashMap<java.lang.Long,RelevantPrecinct> |
relevantPrecincts
FIXME: this object has to be one different for each logical target.
|
protected float[] |
resequencedSlopeThresholds |
private PredictiveScalingFactors |
scalingFactors |
protected StopWatch |
stopWatch |
static int |
WOI_TYPE_BOUNDING_BOX
Prediction of the future window of interest to be requested is based on the
bounding box of the historic of windows of interest.
|
static int |
WOI_TYPE_WEIGHTED_WOI
Prediction of the future window of interest to be requested is based on a
weighted woi considering the historic of windows of interest.
|
Constructor and Description |
---|
Prefetching()
This class constructor is not allowed.
|
Prefetching(java.lang.String threadName,
PrefSemaphore prefSemaphore,
CADILog log)
Constructor.
|
Prefetching(java.lang.String threadName,
PrefSemaphore prefSemaphore,
CADILog log,
int prefetchingWOIType)
Constructor.
|
Prefetching(java.lang.String threadName,
PrefSemaphore prefSemaphore,
CADILog log,
int prefetchingWOIType,
float[] movementProbabilities)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
computeBoundingBox(java.util.ArrayList<ViewWindowField> woisHistory,
JPEG2KCodestream codestream,
CacheManagement cache)
Computes the bounding box of a historic wois.
|
private boolean |
computeWeightedWOI(java.util.ArrayList<ViewWindowField> wois,
JPEG2KCodestream codestream,
CacheManagement cache)
REVIEW: Performs the prefetching using the last woi requested by each client over
the image.
|
protected void |
doPrefetching(java.util.ArrayList<ViewWindowField> woisHistory,
ClientSideSessionTarget sessionTarget,
JPEG2KCodestream codestream,
CacheManagement cache) |
protected void |
doPrefetching(java.util.ArrayList<ViewWindowField> woisHistory,
ClientSideSessionTarget sessionTarget,
JPEG2KCodestream codestream,
CacheManagement cache,
PredictiveScalingFactors scalingFactors) |
private void |
fetchRelevantPrecincts(JPEG2KCodestream codestream,
ClientSideSessionTarget sessionTarget) |
void |
finish()
Indicates that the prefetching has to be finished.
|
private float |
getPenalty(float scalingFactor) |
private void |
getPrecinctWeights(ViewWindowField viewWindowField,
float weight,
JPEG2KCodestream codestream,
CacheManagement cache) |
void |
list(java.io.PrintStream out)
Prints this Prefetching out to the specified output stream.
|
java.lang.String |
toString() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
protected CADILog log
protected boolean finish
finish()
protected PrefSemaphore prefSemaphore
public static final int WOI_TYPE_WEIGHTED_WOI
Precincts are weighted considering their frequency on the historic windows of interest.
public static final int WOI_TYPE_BOUNDING_BOX
protected int prefetchingWOIType
protected StopWatch stopWatch
protected boolean recomputeWOI
private java.util.HashMap<java.lang.Long,RelevantPrecinct> relevantPrecincts
protected Movements movements
protected int[] compressionSlopeThresholds
WindowScalingFactor.compressionSlopeThresholds
.protected float[] resequencedSlopeThresholds
protected static final int NUM_SLOPE_THRESHOLDS
The paper says that "the number of resequenced layers must generally be larger than the number of original code-stream layers", therefore, the number of resequenced layers must be an image dependent value.
In this case, the maximum number of resequenced layer has been set to a fixed value but it will be changed in the next revision.
private PredictiveScalingFactors scalingFactors
private float maxProbMovements
public Prefetching()
public Prefetching(java.lang.String threadName, PrefSemaphore prefSemaphore, CADILog log)
threadName
- definition in Thread.name
.prefSemaphore
- definition in prefSemaphore
.log
- definition in log
.public Prefetching(java.lang.String threadName, PrefSemaphore prefSemaphore, CADILog log, int prefetchingWOIType)
threadName
- definition in Thread.name
.prefSemaphore
- definition in prefSemaphore
.log
- definition in log
.prefetchingWOIType
- definition in prefetchingWOIType
.public Prefetching(java.lang.String threadName, PrefSemaphore prefSemaphore, CADILog log, int prefetchingWOIType, float[] movementProbabilities)
threadName
- definition in Thread.name
.prefSemaphore
- definition in prefSemaphore
.log
- definition in log
.prefetchingWOIType
- definition in prefetchingWOIType
.movementProbabilities
- definition in movements
.protected void doPrefetching(java.util.ArrayList<ViewWindowField> woisHistory, ClientSideSessionTarget sessionTarget, JPEG2KCodestream codestream, CacheManagement cache)
woisHistory
- sessionTarget
- codestream
- cache
- protected void doPrefetching(java.util.ArrayList<ViewWindowField> woisHistory, ClientSideSessionTarget sessionTarget, JPEG2KCodestream codestream, CacheManagement cache, PredictiveScalingFactors scalingFactors)
woisHistory
- sessionTarget
- codestream
- cache
- scalingFactors
- public final void finish()
public java.lang.String toString()
toString
in class java.lang.Thread
public void list(java.io.PrintStream out)
out
- an output stream.private boolean computeBoundingBox(java.util.ArrayList<ViewWindowField> woisHistory, JPEG2KCodestream codestream, CacheManagement cache)
prefetchingWOIType
attribute is WOI_TYPE_BOUNDING_BOX
.woisHistory
- codestream
- cache
- private boolean computeWeightedWOI(java.util.ArrayList<ViewWindowField> wois, JPEG2KCodestream codestream, CacheManagement cache)
wois
- codestream
- cache
- private void fetchRelevantPrecincts(JPEG2KCodestream codestream, ClientSideSessionTarget sessionTarget)
codestream
- sessionTarget
- private void getPrecinctWeights(ViewWindowField viewWindowField, float weight, JPEG2KCodestream codestream, CacheManagement cache)
viewWindowField
- weight
- codestream
- cache
- private float getPenalty(float scalingFactor)
scalingFactor
-
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)