Skip to content

Commit

Permalink
fix python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haoyuan committed Mar 22, 2014
1 parent e82909c commit bf278fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/pyspark/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def _getJavaStorageLevel(self, storageLevel):
raise Exception("storageLevel must be of type pyspark.StorageLevel")

newStorageLevel = self._jvm.org.apache.spark.storage.StorageLevel
return newStorageLevel(storageLevel.useDisk, storageLevel.useMemory,
return newStorageLevel(storageLevel.useDisk, storageLevel.useMemory, storageLevel.userTachyon,
storageLevel.deserialized, storageLevel.replication)

def setJobGroup(self, groupId, description):
Expand Down
3 changes: 2 additions & 1 deletion python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,11 +1178,12 @@ def getStorageLevel(self):
Get the RDD's current storage level.
>>> rdd1 = sc.parallelize([1,2])
>>> rdd1.getStorageLevel()
StorageLevel(False, False, False, 1)
StorageLevel(False, False, False, False, 1)
"""
java_storage_level = self._jrdd.getStorageLevel()
storage_level = StorageLevel(java_storage_level.useDisk(),
java_storage_level.useMemory(),
java_storage_level.useTachyon(),
java_storage_level.deserialized(),
java_storage_level.replication())
return storage_level
Expand Down
4 changes: 2 additions & 2 deletions python/pyspark/storagelevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def __init__(self, useDisk, useMemory, useTachyon, deserialized, replication = 1
self.replication = replication

def __repr__(self):
return "StorageLevel(%s, %s, %s, %s)" % (
self.useDisk, self.useMemory, self.deserialized, self.replication)
return "StorageLevel(%s, %s, %s, %s, %s)" % (
self.useDisk, self.useMemory, self.useTachyon, self.deserialized, self.replication)

StorageLevel.DISK_ONLY = StorageLevel(True, False, False, False)
StorageLevel.DISK_ONLY_2 = StorageLevel(True, False, False, False, 2)
Expand Down

0 comments on commit bf278fa

Please sign in to comment.