Search in sources :

Example 6 with ViewDetail

use of co.cask.cdap.proto.ViewDetail in project cdap by caskdata.

the class InMemoryViewStore method get.

@Override
public ViewDetail get(StreamViewId viewId) throws NotFoundException {
    Lock lock = viewsLock.readLock();
    lock.lock();
    try {
        if (!views.containsRow(viewId)) {
            throw new NotFoundException(viewId);
        }
        return new ViewDetail(viewId.getEntityName(), views.get(viewId, viewId.getParent()));
    } finally {
        lock.unlock();
    }
}
Also used : NotFoundException(co.cask.cdap.common.NotFoundException) ViewDetail(co.cask.cdap.proto.ViewDetail) Lock(java.util.concurrent.locks.Lock) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock)

Aggregations

ViewDetail (co.cask.cdap.proto.ViewDetail)6 NotFoundException (co.cask.cdap.common.NotFoundException)3 FormatSpecification (co.cask.cdap.api.data.format.FormatSpecification)2 ViewSpecification (co.cask.cdap.proto.ViewSpecification)2 StreamId (co.cask.cdap.proto.id.StreamId)2 StreamViewId (co.cask.cdap.proto.id.StreamViewId)2 Test (org.junit.Test)2 Schema (co.cask.cdap.api.data.schema.Schema)1 RowMaker (co.cask.cdap.cli.util.RowMaker)1 Table (co.cask.cdap.cli.util.table.Table)1 ExploreExecutionResult (co.cask.cdap.explore.client.ExploreExecutionResult)1 QueryResult (co.cask.cdap.proto.QueryResult)1 NamespaceId (co.cask.cdap.proto.id.NamespaceId)1 HttpResponse (co.cask.common.http.HttpResponse)1 ImmutableList (com.google.common.collect.ImmutableList)1 TypeToken (com.google.common.reflect.TypeToken)1 URL (java.net.URL)1 List (java.util.List)1 Lock (java.util.concurrent.locks.Lock)1 ReadWriteLock (java.util.concurrent.locks.ReadWriteLock)1