Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified to handle errors during read path #143

Merged
merged 3 commits into from
Mar 21, 2017
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
2 changes: 2 additions & 0 deletions cassandra/src/main/scala/filodb.cassandra/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ object Util {
if (resultSet.wasApplied) Success else notAppliedResponse
}.recover {
case e: DriverException => throw StorageEngineException(e)
case e: Exception => throw StorageEngineException(e)
}
}
}
Expand All @@ -30,6 +31,7 @@ object Util {
// from invalid Enum strings, which should never happen, or some other parsing error
case e: NoSuchElementException => throw MetadataException(e)
case e: IllegalArgumentException => throw MetadataException(e)
case e: Exception => throw StorageEngineException(e)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ sealed class ChunkRowMapTable(dataset: DatasetRef, connector: FiloCassandraConne
version: Int): Future[Iterator[ChunkRowMapRecord]] =
session.executeAsync(allPartReadCql.bind(toBuffer(binPartition),
version: java.lang.Integer))
.toIterator.map(_.map(fromRow))
.toIterator.map(_.map(fromRow)).handleErrors

/**
* Retrieves a whole series of chunk maps, in the range [startSegmentId, untilSegmentId)
Expand All @@ -83,7 +83,7 @@ sealed class ChunkRowMapTable(dataset: DatasetRef, connector: FiloCassandraConne
session.executeAsync(cql.bind(toBuffer(keyRange.partition),
version: java.lang.Integer,
toBuffer(keyRange.start), toBuffer(keyRange.end)))
.toIterator.map(_.map(fromRow))
.toIterator.map(_.map(fromRow)).handleErrors
}

val tokenQ = "TOKEN(partition, version)"
Expand All @@ -99,7 +99,7 @@ sealed class ChunkRowMapTable(dataset: DatasetRef, connector: FiloCassandraConne
.filter(_.getInt("version") == version)
.map { row => fromRow(row) }
}
}
}.handleErrors
}

/**
Expand Down