/** * Gets the next table name to load off the head of the table loading queue. If the queue is * empty, this will block until a new table is added. */ private void loadNextTable() throws InterruptedException { // Always get the next table from the head of the deque. final TTableName tblName = tableLoadingDeque_.takeFirst(); tableLoadingSet_.remove(tblName); LOG.debug("Loading next table. Remaining items in queue: " + tableLoadingDeque_.size()); try { // TODO: Instead of calling "getOrLoad" here we could call "loadAsync". We would // just need to add a mechanism for moving loaded tables into the Catalog. catalog_.getOrLoadTable(tblName.getDb_name(), tblName.getTable_name()); } catch (CatalogException e) { // Ignore. } }
public synchronized void run() { try { while (true) { QueueItem item = queue.takeFirst(); if (item.timeIndex < 0) { frameGroup.encode(out); frameGroup = null; return; } if (item.timeIndex - frameGroup.getTimeIndex() >= keyFrameInterval) { frameGroup.encode(out); frameGroup = new DrawingFrameGroup(player.getCurrentFrame()); frameGroup.setTimeIndex(item.timeIndex); } frameGroup.appendFrame( new DrawingFrame((short) (item.timeIndex - frameGroup.getTimeIndex()), item.action)); } } catch (Exception e) { e.printStackTrace(); } }