Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.apache.sysds.runtime.ooc.cache.BlockEntry;
import org.apache.sysds.runtime.ooc.cache.OOCCacheManager;
import org.apache.sysds.runtime.ooc.cache.OOCCacheScheduler;
import org.apache.sysds.runtime.ooc.cache.legacy.OOCCacheScheduler;

import java.util.ArrayList;
import java.util.Collection;
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/apache/sysds/runtime/ooc/cache/BlockEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class BlockEntry {
private int _retainHintCount;
private int _referenceCount; // The number of references from different managing instances (e.g. CachingStream)

BlockEntry(BlockKey key, long size, Object data) {
public BlockEntry(BlockKey key, long size, Object data) {
this._key = key;
this._size = size;
this._pinCount = 0;
Expand Down Expand Up @@ -68,11 +68,11 @@ public boolean isGrouped() {
throw new IllegalStateException("Cannot get the data of an unpinned entry");
}

Object getDataUnsafe() {
public Object getDataUnsafe() {
return _data;
}

void setDataUnsafe(Object data) {
public void setDataUnsafe(Object data) {
if(data != null && _data != null)
throw new IllegalStateException("Cannot overwrite data");
_data = data;
Expand All @@ -86,15 +86,15 @@ public boolean isPinned() {
return _pinCount > 0;
}

synchronized int addReference() {
public synchronized int addReference() {
return ++_referenceCount;
}

synchronized int forget() {
public synchronized int forget() {
return --_referenceCount;
}

synchronized void setState(BlockState state) {
public synchronized void setState(BlockState state) {
_state = state;
}

Expand Down Expand Up @@ -126,7 +126,7 @@ public synchronized int getRetainHintCount() {
* Tries to clear the underlying data if it is not pinned
* @return the number of cleared bytes (or 0 if could not clear or data was already cleared)
*/
synchronized long clear() {
public synchronized long clear() {
if (_pinCount != 0 || _data == null)
return 0;
if (_data instanceof IndexedMatrixValue)
Expand All @@ -140,7 +140,7 @@ synchronized long clear() {
* Pins the underlying data in memory
* @return the new number of pins (0 if pin was unsuccessful)
*/
synchronized int pin() {
public synchronized int pin() {
if (_data == null)
return 0;
_pinCount++;
Expand All @@ -151,7 +151,7 @@ synchronized int pin() {
* Tries to increment pin-count if already pinned. Unpinned entries are not affected
* by this operation. This allows bypassing the global cache lock.
*/
synchronized boolean fastPin() {
public synchronized boolean fastPin() {
if(_pinCount == 0)
return false;
_pinCount++;
Expand All @@ -162,7 +162,7 @@ synchronized boolean fastPin() {
* Unpins the underlying data
* @return true if the data is now unpinned
*/
synchronized boolean unpin() {
public synchronized boolean unpin() {
if (_pinCount <= 0)
throw new IllegalStateException("Cannot unpin data if it was not pinned");
_pinCount--;
Expand All @@ -173,7 +173,7 @@ synchronized boolean unpin() {
* Tries to unpin but guarantees that it will not
* remove the last pin. This allows bypassing the global cache lock.
*/
synchronized boolean fastUnpin() {
public synchronized boolean fastUnpin() {
if(_pinCount <= 1)
return false;
_pinCount--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.apache.sysds.runtime.instructions.ooc.TeeOOCInstruction;
import org.apache.sysds.runtime.instructions.spark.data.IndexedMatrixValue;
import org.apache.sysds.runtime.matrix.data.MatrixBlock;
import org.apache.sysds.runtime.ooc.cache.legacy.OOCCacheScheduler;
import org.apache.sysds.runtime.ooc.cache.legacy.OOCLRUCacheScheduler;
import org.apache.sysds.runtime.ooc.memory.InMemoryQueueCallback;
import org.apache.sysds.runtime.ooc.stats.OOCEventLog;
import org.apache.sysds.utils.Statistics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
* under the License.
*/

package org.apache.sysds.runtime.ooc.cache;
package org.apache.sysds.runtime.ooc.cache.legacy;

import org.apache.sysds.runtime.ooc.cache.BlockEntry;
import org.apache.sysds.runtime.ooc.cache.BlockKey;

import java.util.ArrayList;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* under the License.
*/

package org.apache.sysds.runtime.ooc.cache;
package org.apache.sysds.runtime.ooc.cache.legacy;

import org.apache.sysds.runtime.ooc.cache.BlockEntry;

import java.util.List;
import java.util.concurrent.CompletableFuture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
* under the License.
*/

package org.apache.sysds.runtime.ooc.cache;
package org.apache.sysds.runtime.ooc.cache.legacy;

import org.apache.sysds.runtime.instructions.ooc.OOCStream;
import org.apache.sysds.runtime.instructions.spark.data.IndexedMatrixValue;
import org.apache.sysds.runtime.ooc.cache.BlockEntry;
import org.apache.sysds.runtime.ooc.cache.BlockKey;
import org.apache.sysds.runtime.ooc.cache.OOCIOHandler;
import org.apache.sysds.runtime.ooc.memory.InMemoryQueueCallback;

import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@
* under the License.
*/

package org.apache.sysds.runtime.ooc.cache;
package org.apache.sysds.runtime.ooc.cache.legacy;

import org.apache.commons.lang3.mutable.MutableObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.sysds.api.DMLScript;
import org.apache.sysds.runtime.instructions.ooc.OOCStream;
import org.apache.sysds.runtime.instructions.spark.data.IndexedMatrixValue;
import org.apache.sysds.runtime.ooc.cache.BlockEntry;
import org.apache.sysds.runtime.ooc.cache.BlockKey;
import org.apache.sysds.runtime.ooc.cache.BlockState;
import org.apache.sysds.runtime.ooc.cache.OOCIOHandler;
import org.apache.sysds.runtime.ooc.memory.InMemoryQueueCallback;
import org.apache.sysds.runtime.ooc.stats.OOCEventLog;
import org.apache.sysds.utils.Statistics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.sysds.runtime.instructions.spark.data.IndexedMatrixValue;
import org.apache.sysds.runtime.ooc.cache.BlockKey;
import org.apache.sysds.runtime.ooc.cache.OOCCacheManager;
import org.apache.sysds.runtime.ooc.cache.OOCCacheScheduler;
import org.apache.sysds.runtime.ooc.cache.legacy.OOCCacheScheduler;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.sysds.runtime.ooc.cache.BlockKey;
import org.apache.sysds.runtime.ooc.cache.BlockState;
import org.apache.sysds.runtime.ooc.cache.OOCIOHandler;
import org.apache.sysds.runtime.ooc.cache.OOCLRUCacheScheduler;
import org.apache.sysds.runtime.ooc.cache.legacy.OOCLRUCacheScheduler;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.sysds.runtime.ooc.cache.BlockKey;
import org.apache.sysds.runtime.ooc.cache.BlockState;
import org.apache.sysds.runtime.ooc.cache.OOCIOHandler;
import org.apache.sysds.runtime.ooc.cache.OOCLRUCacheScheduler;
import org.apache.sysds.runtime.ooc.cache.legacy.OOCLRUCacheScheduler;
import org.apache.sysds.runtime.ooc.cache.OOCMatrixIOHandler;
import org.apache.sysds.test.AutomatedTestBase;
import org.apache.sysds.test.TestConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class LmCGTest extends AutomatedTestBase {
private final static String TEST_NAME1 = "lmCG";
private final static String TEST_DIR = "functions/ooc/";
private final static String TEST_CLASS_DIR = TEST_DIR + LmCGTest.class.getSimpleName() + "/";
private final static double eps = 1e-8;
private final static double eps = 1e-7;
private static final String INPUT_NAME_1 = "X";
private static final String INPUT_NAME_2 = "y";
private static final String OUTPUT_NAME = "res";
Expand Down
Loading