Address review comments @nalexander

This commit is contained in:
Emily Toop 2018-05-14 19:40:46 +01:00
parent 35467c1b24
commit 2c0f755632
3 changed files with 27 additions and 27 deletions

View file

@ -50,6 +50,23 @@ public class FFIIntegrationTest {
} }
} }
class QueryTimer {
private long startTime = 0;
private long endTime = 0;
public void start() {
this.startTime = System.nanoTime();
}
public void end() {
this.endTime = System.nanoTime();
}
public long duration() {
return this.endTime - this.startTime;
}
}
Mentat mentat = null; Mentat mentat = null;
@Test @Test
@ -1302,20 +1319,3 @@ public class FFIIntegrationTest {
} }
} }
class QueryTimer {
private long startTime = 0;
private long endTime = 0;
public void start() {
this.startTime = System.nanoTime();
}
public void end() {
this.endTime = System.nanoTime();
}
public long duration() {
return this.endTime - this.startTime;
}
}

View file

@ -52,7 +52,7 @@ public class Mentat extends RustObject {
* Add an attribute to the cache. The {@link CacheDirection} determines how that attribute can be * Add an attribute to the cache. The {@link CacheDirection} determines how that attribute can be
* looked up. * looked up.
* *
* TODO: Throw an exception if cache action fails * TODO: Throw an exception if cache action fails. https://github.com/mozilla/mentat/issues/700
* *
* @param attribute The attribute to cache * @param attribute The attribute to cache
* @param direction The direction the attribute should be keyed. * @param direction The direction the attribute should be keyed.
@ -79,7 +79,7 @@ public class Mentat extends RustObject {
/** /**
* Simple transact of an EDN string. * Simple transact of an EDN string.
* TODO: Throw an exception if the transact fails * TODO: Throw an exception if the transact fails. https://github.com/mozilla/mentat/issues/700
* @param transaction The string, as EDN, to be transacted. * @param transaction The string, as EDN, to be transacted.
* @return The {@link TxReport} of the completed transaction * @return The {@link TxReport} of the completed transaction
*/ */
@ -117,7 +117,7 @@ public class Mentat extends RustObject {
/** /**
* Retrieve a single value of an attribute for an Entity * Retrieve a single value of an attribute for an Entity
* TODO: Throw an exception if the result contains an error. * TODO: Throw an exception if the result contains an error. https://github.com/mozilla/mentat/issues/700
* @param attribute The string the attribute whose value is to be returned. The string is represented as `:namespace/name`. * @param attribute The string the attribute whose value is to be returned. The string is represented as `:namespace/name`.
* @param entid The `Entid` of the entity we want the value from. * @param entid The `Entid` of the entity we want the value from.
* @return The {@link TypedValue} containing the value of the attribute for the entity. * @return The {@link TypedValue} containing the value of the attribute for the entity.
@ -171,7 +171,7 @@ public class Mentat extends RustObject {
/** /**
* Start a new transaction * Start a new transaction
* *
* TODO: Throw an exception if the result contains an error. * TODO: Throw an exception if the result contains an error. https://github.com/mozilla/mentat/issues/700
* *
* @return The {@link InProgress} used to manage the transaction * @return The {@link InProgress} used to manage the transaction
*/ */
@ -192,7 +192,7 @@ public class Mentat extends RustObject {
* Creates a new transaction ({@link InProgress}) and returns an {@link InProgressBuilder} for * Creates a new transaction ({@link InProgress}) and returns an {@link InProgressBuilder} for
* that transaction. * that transaction.
* *
* TODO: Throw an exception if the result contains an error. * TODO: Throw an exception if the result contains an error. https://github.com/mozilla/mentat/issues/700
* *
* @return an {@link InProgressBuilder} for a new transaction. * @return an {@link InProgressBuilder} for a new transaction.
*/ */
@ -213,7 +213,7 @@ public class Mentat extends RustObject {
* Creates a new transaction ({@link InProgress}) and returns an {@link EntityBuilder} for the * Creates a new transaction ({@link InProgress}) and returns an {@link EntityBuilder} for the
* entity with `entid` for that transaction. * entity with `entid` for that transaction.
* *
* TODO: Throw an exception if the result contains an error. * TODO: Throw an exception if the result contains an error. https://github.com/mozilla/mentat/issues/700
* *
* @param entid The `Entid` for this entity. * @param entid The `Entid` for this entity.
* @return an {@link EntityBuilder} for a new transaction. * @return an {@link EntityBuilder} for a new transaction.
@ -235,7 +235,7 @@ public class Mentat extends RustObject {
* Creates a new transaction ({@link InProgress}) and returns an {@link EntityBuilder} for a new * Creates a new transaction ({@link InProgress}) and returns an {@link EntityBuilder} for a new
* entity with `tempId` for that transaction. * entity with `tempId` for that transaction.
* *
* TODO: Throw an exception if the result contains an error. * TODO: Throw an exception if the result contains an error. https://github.com/mozilla/mentat/issues/700
* *
* @param tempId The temporary identifier for this entity. * @param tempId The temporary identifier for this entity.
* @return an {@link EntityBuilder} for a new transaction. * @return an {@link EntityBuilder} for a new transaction.

View file

@ -68,11 +68,11 @@ class Mentat: RustObject {
- Parameter attribute: The attribute to cache - Parameter attribute: The attribute to cache
- Parameter direction: The direction the attribute should be keyed. - Parameter direction: The direction the attribute should be keyed.
`FORWARD` caches values for an attribute keyed by entity `forward` caches values for an attribute keyed by entity
(i.e. find values and entities that have this attribute, or find values of attribute for an entity) (i.e. find values and entities that have this attribute, or find values of attribute for an entity)
`REVERSE` caches entities for an attribute keyed by value. `reverse` caches entities for an attribute keyed by value.
(i.e. find entities that have a particular value for an attribute). (i.e. find entities that have a particular value for an attribute).
`BOTH` adds an attribute such that it is cached in both directions. `both` adds an attribute such that it is cached in both directions.
- Throws: `ResultError.error` if an error occured while trying to cache the attribute. - Throws: `ResultError.error` if an error occured while trying to cache the attribute.
*/ */