Return the lineage inputs graph for the given tableName.

@param tableName tableName
@return Inputs Graph as JSON
550718
@Override
    @GraphTransaction
    public String getInputsGraph(String tableName) throws AtlasException {
        LOG.info("Fetching lineage inputs graph for tableName={}", tableName);
        tableName = ParamChecker.notEmpty(tableName, "table name");
        TypeUtils.Pair<String, String> typeIdPair = validateDatasetNameExists(tableName);
        return getInputsGraphForId(typeIdPair.right);
    }
251502
public VoltTable sortByInput(String tableName)
    {
        List<ProcInputRow> sorted = new ArrayList<ProcInputRow>(m_rowsTable);
        Collections.sort(sorted, new Comparator<ProcInputRow>() {
            @Override
            public int compare(ProcInputRow r1, ProcInputRow r2) {
                return compareByInput(r2, r1); // sort descending
            }
        });

        long totalInput = 0L;
        for (ProcInputRow row : sorted) {
            totalInput += (row.avgIN * row.invocations);
        }

        int kB = 1024;
        int mB = 1024 * kB;

        VoltTable result = TableShorthand.tableFromShorthand(
            tableName +
            "(TIMESTAMP:BIGINT," +
                "PROCEDURE:VARCHAR," +
                "WEIGHTED_PERC:BIGINT," +
                "INVOCATIONS:BIGINT," +
                "MIN_PARAMETER_SET_SIZE:BIGINT," +
                "MAX_PARAMETER_SET_SIZE:BIGINT," +
                "AVG_PARAMETER_SET_SIZE:BIGINT," +
                "TOTAL_PARAMETER_SET_SIZE_MB:BIGINT)"
                );

        for (ProcInputRow row : sorted) {
            result.addRow(
                row.timestamp,
                row.procedure,
                calculatePercent((row.avgIN * row.invocations), totalInput), //% total in
                row.invocations,
                row.minIN,
                row.maxIN,
                row.avgIN,
                (row.avgIN * row.invocations) / mB //total in
                );
        }
        return result;
    }
592298
public BaseTable getTableAt(Object objKey)
    {
        if (m_mapTable != null)
            if (objKey != null)
                return (BaseTable)m_mapTable.get(objKey);
        return null;
    }
1043021
protected Map<String,String> getAttributeTable(String tableName) {
    String prefix = contextName + "." + tableName + ".";
    Map<String,String> result = new HashMap<String,String>();
    for (String attributeName : factory.getAttributeNames()) {
      if (attributeName.startsWith(prefix)) {
        String name = attributeName.substring(prefix.length());
        String value = (String) factory.getAttribute(attributeName);
        result.put(name, value);
      }
    }
    return result;
  }
226503
public Table getTable(String datasetName, String tableName) {
    // [START ]
    Table table = bigquery.getTable(datasetName, tableName);
    // [END ]
    return table;
  }
416218
public String classToTableName(String className) {
    String tableName = null;
    try {
      tableName = tableNamingStrategy.classToTableName(Class.forName(className));
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }
    if (tableName.length() > MaxLength) logger.warn("{}'s length greate than 30!", tableName);
    logger.debug("Mapping entity[{}] to {}", className, tableName);
    return tableName;
  }
203177
public Rule TableColumn(Var<TableNode> tableNode, Var<Boolean> pipeSeen) {
        Var<TableColumnNode> node = new Var<TableColumnNode>(new TableColumnNode());
        return Sequence(
                NodeSequence(
                        push(node.get()),
                        Sp(),
                        Optional(':', node.get().markLeftAligned()),
                        Sp(), OneOrMore('-'), Sp(),
                        Optional(':', node.get().markRightAligned()),
                        Sp(),
                        Optional('|', pipeSeen.set(Boolean.TRUE))
                ),
                tableNode.get().addColumn((TableColumnNode) pop())
        );
    }
860790
@GET
    @Path("{guid}/outputs/graph")
    @Consumes(Servlets.JSON_MEDIA_TYPE)
    @Produces(Servlets.JSON_MEDIA_TYPE)
    public Response outputsGraph(@PathParam("guid") String guid) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("==> LineageResource.outputsGraph({})", guid);
        }

        AtlasPerfTracer perf = null;

        try {
            if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
                perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "LineageResource.outputsGraph(" + guid + ")");
            }

            AtlasLineageInfo lineageInfo = atlasLineageService.getAtlasLineageInfo(guid, LineageDirection.OUTPUT, -1);
            final String result = LineageUtils.toLineageStruct(lineageInfo, typeRegistry);

            JSONObject response = new JSONObject();
            response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId());
            response.put(AtlasClient.RESULTS, new JSONObject(result));

            return Response.ok(response).build();
        } catch (AtlasBaseException e) {
            LOG.error("Unable to get lineage outputs graph for entity guid={}", guid, e);
            throw new WebApplicationException(Servlets.getErrorResponse(e));
        } catch (WebApplicationException e) {
            LOG.error("Unable to get lineage outputs graph for entity guid={}", guid, e);
            throw e;
        } catch (JSONException e) {
            LOG.error("Unable to get lineage outputs graph for entity guid={}", guid, e);
            throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR));
        } finally {
            AtlasPerfTracer.log(perf);

            if (LOG.isDebugEnabled()) {
                LOG.debug("<== LineageResource.outputsGraph({})", guid);
            }
        }
    }
1182982
public GeometryColumns queryForTableName(String tableName)
			throws SQLException {
		GeometryColumns geometryColumns = null;
		if (tableName != null) {
			List<GeometryColumns> results = queryForEq(
					GeometryColumns.COLUMN_TABLE_NAME, tableName);
			if (!results.isEmpty()) {
				if (results.size() > 1) {
					throw new SQLException("More than one "
							+ GeometryColumns.class.getSimpleName()
							+ " returned for Table Name: " + tableName);
				}
				geometryColumns = results.get(0);
			}
		}
		return geometryColumns;
	}
345709
public AsyncIterator<String> getAllKeys(String tableName) {
        return new ContinuationTokenAsyncIterator<>(token -> getKeysPaginated(tableName, token, 1000)
                .thenApplyAsync(result -> {
                    token.release();
                    return new AbstractMap.SimpleEntry<>(result.getKey(), result.getValue());
                }, executor),
                IteratorState.EMPTY.toBytes());
    }
18454
def to_graph(self):
        """"""
        def json_node(graph, element, prefix):
            if not element:
                return None
            node_id = '|'.join(prefix)
            if isinstance(element, list):
                graph.add_node(node_id, label='')
                # Enumerate children and add nodes and connect to anchor node
                for i, sub_element in enumerate(element):
                    sub_id = json_node(graph, sub_element, prefix + ['%s' % i])
                    if sub_id:
                        graph.add_edge(node_id, sub_id, label='')
            elif isinstance(element, dict):
                graph.add_node(node_id, label='')
                # Add node recursively for each element
                # Connect to this node with edge label according to key
                for k, v in element.items():
                    if k == 'id':
                        continue
                    elif k == 'name':
                        graph.node[node_id]['label'] = v
                        continue
                    elif k == 'type':
                        graph.node[node_id]['label'] = v
                        continue

                    sub_id = json_node(graph, v, prefix + ['%s' % k])
                    if sub_id:
                        graph.add_edge(node_id, sub_id, label=('%s' % k))
            else:
                if isinstance(element, basestring) and \
                   element.startswith('http'):
                    element = element.split('/')[-1]
                graph.add_node(node_id, label=('%s' % str(element)))
            return node_id
        jd = self.to_json()
        graph = networkx.DiGraph()
        json_node(graph, jd, ['%s' % self.uuid])
        return graph
438204
public TopologyAPI.Topology getTopology(String topologyName) {
    return awaitResult(delegate.getTopology(null, topologyName));
  }
1051590
@GuardedBy("this")
    private TableSource getTableSource(String databaseName, String tableName)
    {
        checkHoldsLock();

        checkReadable();
        Action<TableAndMore> tableAction = tableActions.get(new SchemaTableName(databaseName, tableName));
        if (tableAction == null) {
            return TableSource.PRE_EXISTING_TABLE;
        }
        switch (tableAction.getType()) {
            case ADD:
                return TableSource.CREATED_IN_THIS_TRANSACTION;
            case ALTER:
                throw new IllegalStateException("Tables are never altered in the current implementation");
            case DROP:
                throw new TableNotFoundException(new SchemaTableName(databaseName, tableName));
            case INSERT_EXISTING:
                return TableSource.PRE_EXISTING_TABLE;
            default:
                throw new IllegalStateException("Unknown action type");
        }
    }
1094623
public Optional<RoutingTable> getRoutingTable(final String dataSourceName, final String actualTableName) {
        for (TableUnit each : tableUnits) {
            Optional<RoutingTable> result = each.getRoutingTable(dataSourceName, actualTableName);
            if (result.isPresent()) {
                return result;
            }
        }
        return Optional.absent();
    }
384139
@Override
    public Object getTable(final String tableName)
    {
        logger.debug("TEPHRA Begin of getTable for " + tableName);
        final TransactionAwareHTable table = tableNameHandleMap.get(tableName);
        if (table == null) {
            // TODO propagate exceptions
            logger.error("TEPHRA error: unebale to find cached table " + tableName);
            return table;
        } else {
            logger.debug("TEPHRA Found a cached handle for table " + tableName);
            return table;
        }
    }
52751
public List<Long> getMappingsForBase(String tableName, long baseId) {

		List<Long> relatedIds = new ArrayList<>();

		UserMappingDao userMappingDao = getMappingDao(tableName);
		UserCustomResultSet resultSet = userMappingDao.queryByBaseId(baseId);
		try {
			while (resultSet.moveToNext()) {
				UserMappingRow row = userMappingDao.getRow(resultSet);
				relatedIds.add(row.getRelatedId());
			}
		} finally {
			resultSet.close();
		}

		return relatedIds;
	}
992945
public static Cells getCellFromJson(LinkedMapWritable jsonObject, String tableName) throws IllegalAccessException,
            InstantiationException, InvocationTargetException, NoSuchMethodException {

        Cells cells = tableName != null ? new Cells(tableName) : new Cells();

        Set<Map.Entry<Writable, Writable>> entryJson = jsonObject.entrySet();

        for (Map.Entry<Writable, Writable> entry : entryJson) {

            if (LinkedMapWritable.class.isAssignableFrom(entry.getValue().getClass())) {
                Cells innerCells = getCellFromJson((LinkedMapWritable) entry.getValue(), null);
                cells.add(Cell.create(entry.getKey().toString(), innerCells));
            } else if (ArrayWritable.class.isAssignableFrom(entry.getValue().getClass())) {
                Writable[] writetable = ((ArrayWritable) entry.getValue()).get();
                List innerCell = new ArrayList<>();
                for (int i = 0; i < writetable.length; i++) {
                    if(writetable[i] instanceof LinkedMapWritable){
                        innerCell.add(getCellFromJson((LinkedMapWritable) writetable[i], null));
                    }else{
                        innerCell.add(getObjectFromWritable(entry.getValue()));
                    }

                }
                cells.add(Cell.create(entry.getKey().toString(), innerCell));
            } else {

                cells.add(Cell.create(entry.getKey().toString(), getObjectFromWritable(entry.getValue())));
            }

        }
        return cells;
    }