Search in sources :

Example 81 with Entry

use of java.util.Map.Entry in project android_frameworks_base by ResurrectionRemix.

the class MountService method dump.

@Override
protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
    mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
    final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ", 160);
    synchronized (mLock) {
        pw.println("Disks:");
        pw.increaseIndent();
        for (int i = 0; i < mDisks.size(); i++) {
            final DiskInfo disk = mDisks.valueAt(i);
            disk.dump(pw);
        }
        pw.decreaseIndent();
        pw.println();
        pw.println("Volumes:");
        pw.increaseIndent();
        for (int i = 0; i < mVolumes.size(); i++) {
            final VolumeInfo vol = mVolumes.valueAt(i);
            if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id))
                continue;
            vol.dump(pw);
        }
        pw.decreaseIndent();
        pw.println();
        pw.println("Records:");
        pw.increaseIndent();
        for (int i = 0; i < mRecords.size(); i++) {
            final VolumeRecord note = mRecords.valueAt(i);
            note.dump(pw);
        }
        pw.decreaseIndent();
        pw.println();
        pw.println("Primary storage UUID: " + mPrimaryStorageUuid);
        final Pair<String, Long> pair = StorageManager.getPrimaryStoragePathAndSize();
        if (pair == null) {
            pw.println("Internal storage total size: N/A");
        } else {
            pw.print("Internal storage (");
            pw.print(pair.first);
            pw.print(") total size: ");
            pw.print(pair.second);
            pw.print(" (");
            pw.print((float) pair.second / TrafficStats.GB_IN_BYTES);
            pw.println(" GB)");
        }
        pw.println("Force adoptable: " + mForceAdoptable);
        pw.println();
        pw.println("Local unlocked users: " + Arrays.toString(mLocalUnlockedUsers));
        pw.println("System unlocked users: " + Arrays.toString(mSystemUnlockedUsers));
    }
    synchronized (mObbMounts) {
        pw.println();
        pw.println("mObbMounts:");
        pw.increaseIndent();
        final Iterator<Entry<IBinder, List<ObbState>>> binders = mObbMounts.entrySet().iterator();
        while (binders.hasNext()) {
            Entry<IBinder, List<ObbState>> e = binders.next();
            pw.println(e.getKey() + ":");
            pw.increaseIndent();
            final List<ObbState> obbStates = e.getValue();
            for (final ObbState obbState : obbStates) {
                pw.println(obbState);
            }
            pw.decreaseIndent();
        }
        pw.decreaseIndent();
        pw.println();
        pw.println("mObbPathToStateMap:");
        pw.increaseIndent();
        final Iterator<Entry<String, ObbState>> maps = mObbPathToStateMap.entrySet().iterator();
        while (maps.hasNext()) {
            final Entry<String, ObbState> e = maps.next();
            pw.print(e.getKey());
            pw.print(" -> ");
            pw.println(e.getValue());
        }
        pw.decreaseIndent();
    }
    pw.println();
    pw.println("mConnector:");
    pw.increaseIndent();
    mConnector.dump(fd, pw, args);
    pw.decreaseIndent();
    pw.println();
    pw.println("mCryptConnector:");
    pw.increaseIndent();
    mCryptConnector.dump(fd, pw, args);
    pw.decreaseIndent();
    pw.println();
    pw.print("Last maintenance: ");
    pw.println(TimeUtils.formatForLogging(mLastMaintenance));
}
Also used : DiskInfo(android.os.storage.DiskInfo) VolumeInfo(android.os.storage.VolumeInfo) VolumeRecord(android.os.storage.VolumeRecord) Entry(java.util.Map.Entry) IBinder(android.os.IBinder) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) RemoteCallbackList(android.os.RemoteCallbackList) List(java.util.List) LinkedList(java.util.LinkedList) IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

Example 82 with Entry

use of java.util.Map.Entry in project opennms by OpenNMS.

the class NewtsFetchStrategy method fetch.

@Override
public FetchResults fetch(long start, long end, long step, int maxrows, Long interval, Long heartbeat, List<Source> sources, boolean relaxed) {
    final LateAggregationParams lag = getLagParams(step, interval, heartbeat);
    final Optional<Timestamp> startTs = Optional.of(Timestamp.fromEpochMillis(start));
    final Optional<Timestamp> endTs = Optional.of(Timestamp.fromEpochMillis(end));
    final Map<String, Object> constants = Maps.newHashMap();
    // Group the sources by resource id to avoid calling the ResourceDao
    // multiple times for the same resource
    Map<ResourceId, List<Source>> sourcesByResourceId = sources.stream().collect(Collectors.groupingBy((source) -> ResourceId.fromString(source.getResourceId())));
    // Lookup the OnmsResources in parallel
    Map<ResourceId, Future<OnmsResource>> resourceFuturesById = Maps.newHashMapWithExpectedSize(sourcesByResourceId.size());
    for (ResourceId resourceId : sourcesByResourceId.keySet()) {
        resourceFuturesById.put(resourceId, threadPool.submit(getResourceByIdCallable(resourceId)));
    }
    // Gather the results, fail if any of the resources were not found
    Map<OnmsResource, List<Source>> sourcesByResource = Maps.newHashMapWithExpectedSize(sourcesByResourceId.size());
    for (Entry<ResourceId, Future<OnmsResource>> entry : resourceFuturesById.entrySet()) {
        try {
            OnmsResource resource = entry.getValue().get();
            if (resource == null) {
                if (relaxed)
                    continue;
                LOG.error("No resource with id: {}", entry.getKey());
                return null;
            }
            sourcesByResource.put(resource, sourcesByResourceId.get(entry.getKey()));
        } catch (ExecutionException | InterruptedException e) {
            throw Throwables.propagate(e);
        }
    }
    // Now group the sources by Newts Resource ID, which differs from the OpenNMS Resource ID.
    Map<String, List<Source>> sourcesByNewtsResourceId = Maps.newHashMap();
    for (Entry<OnmsResource, List<Source>> entry : sourcesByResource.entrySet()) {
        final OnmsResource resource = entry.getKey();
        for (Source source : entry.getValue()) {
            // Gather the values from strings.properties
            Utils.convertStringAttributesToConstants(source.getLabel(), resource.getStringPropertyAttributes(), constants);
            // Grab the attribute that matches the source
            RrdGraphAttribute rrdGraphAttribute = resource.getRrdGraphAttributes().get(source.getAttribute());
            if (rrdGraphAttribute == null && !Strings.isNullOrEmpty(source.getFallbackAttribute())) {
                LOG.error("No attribute with name '{}', using fallback-attribute with name '{}'", source.getAttribute(), source.getFallbackAttribute());
                source.setAttribute(source.getFallbackAttribute());
                source.setFallbackAttribute(null);
                rrdGraphAttribute = resource.getRrdGraphAttributes().get(source.getAttribute());
            }
            if (rrdGraphAttribute == null) {
                if (relaxed)
                    continue;
                LOG.error("No attribute with name: {}", source.getAttribute());
                return null;
            }
            // The Newts Resource ID is stored in the rrdFile attribute
            String newtsResourceId = rrdGraphAttribute.getRrdRelativePath();
            // Remove the file separator prefix, added by the RrdGraphAttribute class
            if (newtsResourceId.startsWith(File.separator)) {
                newtsResourceId = newtsResourceId.substring(File.separator.length(), newtsResourceId.length());
            }
            List<Source> listOfSources = sourcesByNewtsResourceId.get(newtsResourceId);
            // Create the list if it doesn't exist
            if (listOfSources == null) {
                listOfSources = Lists.newLinkedList();
                sourcesByNewtsResourceId.put(newtsResourceId, listOfSources);
            }
            listOfSources.add(source);
        }
    }
    // The Newts API only allows us to perform a query using a single (Newts) Resource ID,
    // so we perform multiple queries in parallel, and aggregate the results.
    Map<String, Future<Collection<Row<Measurement>>>> measurementsByNewtsResourceId = Maps.newHashMapWithExpectedSize(sourcesByNewtsResourceId.size());
    for (Entry<String, List<Source>> entry : sourcesByNewtsResourceId.entrySet()) {
        measurementsByNewtsResourceId.put(entry.getKey(), threadPool.submit(getMeasurementsForResourceCallable(entry.getKey(), entry.getValue(), startTs, endTs, lag)));
    }
    long[] timestamps = null;
    Map<String, double[]> columns = Maps.newHashMap();
    for (Entry<String, Future<Collection<Row<Measurement>>>> entry : measurementsByNewtsResourceId.entrySet()) {
        Collection<Row<Measurement>> rows;
        try {
            rows = entry.getValue().get();
        } catch (InterruptedException | ExecutionException e) {
            throw Throwables.propagate(e);
        }
        final int N = rows.size();
        if (timestamps == null) {
            timestamps = new long[N];
            int k = 0;
            for (final Row<Measurement> row : rows) {
                timestamps[k] = row.getTimestamp().asMillis();
                k++;
            }
        }
        int k = 0;
        for (Row<Measurement> row : rows) {
            for (Measurement measurement : row.getElements()) {
                double[] column = columns.get(measurement.getName());
                if (column == null) {
                    column = new double[N];
                    columns.put(measurement.getName(), column);
                }
                column[k] = measurement.getValue();
            }
            k += 1;
        }
    }
    FetchResults fetchResults = new FetchResults(timestamps, columns, lag.getStep(), constants);
    if (relaxed) {
        Utils.fillMissingValues(fetchResults, sources);
    }
    LOG.trace("Fetch results: {}", fetchResults);
    return fetchResults;
}
Also used : ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) Context(org.opennms.newts.api.Context) StandardAggregationFunctions(org.opennms.newts.api.query.StandardAggregationFunctions) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) Callable(java.util.concurrent.Callable) AggregationFunction(org.opennms.newts.api.query.AggregationFunction) Utils(org.opennms.netmgt.measurements.utils.Utils) SampleRepository(org.opennms.newts.api.SampleRepository) Strings(com.google.common.base.Strings) Future(java.util.concurrent.Future) Lists(com.google.common.collect.Lists) Optional(com.google.common.base.Optional) Map(java.util.Map) OnmsResource(org.opennms.netmgt.model.OnmsResource) ThreadFactory(java.util.concurrent.ThreadFactory) ResultDescriptor(org.opennms.newts.api.query.ResultDescriptor) RrdGraphAttribute(org.opennms.netmgt.model.RrdGraphAttribute) ExecutorService(java.util.concurrent.ExecutorService) SampleSelectCallback(org.opennms.newts.api.SampleSelectCallback) ResourceId(org.opennms.netmgt.model.ResourceId) Logger(org.slf4j.Logger) Semaphore(java.util.concurrent.Semaphore) Collection(java.util.Collection) Resource(org.opennms.newts.api.Resource) Throwables(com.google.common.base.Throwables) Collectors(java.util.stream.Collectors) Maps(com.google.common.collect.Maps) File(java.io.File) Executors(java.util.concurrent.Executors) Row(org.opennms.newts.api.Results.Row) ExecutionException(java.util.concurrent.ExecutionException) FetchResults(org.opennms.netmgt.measurements.api.FetchResults) List(java.util.List) Duration(org.opennms.newts.api.Duration) Results(org.opennms.newts.api.Results) MeasurementFetchStrategy(org.opennms.netmgt.measurements.api.MeasurementFetchStrategy) Measurement(org.opennms.newts.api.Measurement) Entry(java.util.Map.Entry) Timestamp(org.opennms.newts.api.Timestamp) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ResourceDao(org.opennms.netmgt.dao.api.ResourceDao) Source(org.opennms.netmgt.measurements.model.Source) Measurement(org.opennms.newts.api.Measurement) Timestamp(org.opennms.newts.api.Timestamp) Source(org.opennms.netmgt.measurements.model.Source) RrdGraphAttribute(org.opennms.netmgt.model.RrdGraphAttribute) FetchResults(org.opennms.netmgt.measurements.api.FetchResults) List(java.util.List) ExecutionException(java.util.concurrent.ExecutionException) OnmsResource(org.opennms.netmgt.model.OnmsResource) ResourceId(org.opennms.netmgt.model.ResourceId) Future(java.util.concurrent.Future) Row(org.opennms.newts.api.Results.Row)

Example 83 with Entry

use of java.util.Map.Entry in project tdi-studio-se by Talend.

the class TracesConnectionUtils method createConnection.

/**
     * DOC hwang Comment method "createConnection".
     */
public static DatabaseConnection createConnection(ConnectionParameters parameters) {
    ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
    String dbType = parameters.getDbType();
    boolean isNeedSchema = EDatabaseTypeName.getTypeFromDbType(dbType).isNeedSchema();
    String productName = EDatabaseTypeName.getTypeFromDisplayName(dbType).getProduct();
    // boolean isOralceWithSid = productName.equals(EDatabaseTypeName.ORACLEFORSID.getProduct());
    String schema = parameters.getSchema();
    EDatabaseTypeName type = EDatabaseTypeName.getTypeFromDbType(dbType);
    if (ManagerConnection.isSchemaFromSidOrDatabase(type)) {
        schema = parameters.getDbName();
    }
    if ("".equals(schema) && EDatabaseTypeName.INFORMIX.getProduct().equals(productName)) {
        //$NON-NLS-1$
        schema = parameters.getUserName();
    }
    if (EDatabaseTypeName.EXASOL.getProduct().equals(productName)) {
        schema = parameters.getDbName();
    }
    boolean isSchemaInValid = //$NON-NLS-1$ //$NON-NLS-2$
    (schema == null) || (schema.equals("\'\'")) || (schema.equals("\"\"")) || //$NON-NLS-1$
    (schema.trim().equals(""));
    // from 616 till line 622 modified by hyWang
    NotReallyNeedSchemaDBS dbs = new NotReallyNeedSchemaDBS();
    dbs.init();
    List<String> names = dbs.getNeedSchemaDBNames();
    boolean ifNeedSchemaDB = names.contains(productName);
    if (isNeedSchema && isSchemaInValid && !ifNeedSchemaDB) {
        //$NON-NLS-1$
        parameters.setConnectionComment(Messages.getString("TracesConnectionUtils.connectionComment"));
        return null;
    }
    DatabaseConnection connection = ConnectionFactory.eINSTANCE.createDatabaseConnection();
    connection.setFileFieldName(parameters.getFilename());
    connection.setDatabaseType(dbType);
    connection.setUsername(parameters.getUserName());
    connection.setPort(parameters.getPort());
    connection.setRawPassword(parameters.getPassword());
    if (dbType != null && dbType.equals(EDatabaseTypeName.ORACLE_OCI.getDisplayName()) && parameters.getLocalServiceName() != null && !"".equals(parameters.getLocalServiceName())) {
        connection.setSID(parameters.getLocalServiceName());
    } else {
        connection.setSID(parameters.getDbName());
    }
    connection.setLabel(parameters.getDbName());
    connection.setDatasourceName(parameters.getDatasource());
    if (parameters.getDbType().equals(EDatabaseTypeName.GODBC.getDisplayName()) && StringUtils.isEmpty(parameters.getDatasource())) {
        connection.setDatasourceName(parameters.getDbName());
    }
    if ("".equals(connection.getLabel())) {
        //$NON-NLS-1$
        connection.setLabel(parameters.getDatasource());
    }
    String driverClassByDbType = null;
    if (parameters.getDriverClass() != null) {
        driverClassByDbType = parameters.getDriverClass();
    } else {
        driverClassByDbType = extractMeta.getDriverClassByDbType(dbType);
    }
    String driverJar = parameters.getDriverJar();
    connection.setDriverClass(driverClassByDbType);
    connection.setDriverJarPath(driverJar);
    String databaseType = connection.getDatabaseType();
    if (driverClassByDbType != null && !"".equals(driverClassByDbType) && EDatabaseTypeName.GENERAL_JDBC.getDisplayName().equals(parameters.getDbType())) {
        if (driverClassByDbType.startsWith("\"") && driverClassByDbType.endsWith("\"")) {
            driverClassByDbType = TalendTextUtils.removeQuotes(driverClassByDbType);
        }
        String dbTypeByClassName = "";
        if (driverJar != null && !"".equals(driverJar)) {
            dbTypeByClassName = extractMeta.getDbTypeByClassNameAndDriverJar(driverClassByDbType, driverJar);
        } else {
            dbTypeByClassName = extractMeta.getDbTypeByClassName(driverClassByDbType);
        }
        if (dbTypeByClassName != null) {
            databaseType = dbTypeByClassName;
        }
    }
    final String product = EDatabaseTypeName.getTypeFromDisplayName(databaseType).getProduct();
    ;
    connection.setProductId(product);
    if (MetadataTalendType.getDefaultDbmsFromProduct(product) != null) {
        final String mapping = MetadataTalendType.getDefaultDbmsFromProduct(product).getId();
        connection.setDbmsId(mapping);
    }
    if (!isSchemaInValid && isNeedSchema) {
        //$NON-NLS-1$ //$NON-NLS-2$
        schema = schema.replaceAll("\'", "");
        //$NON-NLS-1$ //$NON-NLS-2$
        schema = schema.replaceAll("\"", "");
        connection.setUiSchema(schema);
    }
    connection.setServerName(parameters.getHost());
    connection.setAdditionalParams(parameters.getJdbcProperties());
    connection.setURL(parameters.getCombineURL());
    connection.setDBRootPath(parameters.getDirectory());
    connection.setDbVersionString(parameters.getDbVersion());
    // Added by Marvin Wang to add other parameters.
    Map<String, String> params = parameters.getParameters();
    if (params != null && params.size() > 0) {
        Set<Entry<String, String>> collection = params.entrySet();
        for (Entry<String, String> para : collection) {
            connection.getParameters().put(para.getKey(), para.getValue());
        }
    }
    return connection;
}
Also used : Entry(java.util.Map.Entry) NotReallyNeedSchemaDBS(org.talend.designer.core.sqlbuilder.NotReallyNeedSchemaDBS) ExtractMetaDataUtils(org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) EDatabaseTypeName(org.talend.core.database.EDatabaseTypeName)

Example 84 with Entry

use of java.util.Map.Entry in project tdi-studio-se by Talend.

the class JobletContainerFigure method removeFromParentMRFigure.

private void removeFromParentMRFigure() {
    if (this.parentMRFigure == null) {
        return;
    }
    Iterator<Entry<String, SimpleHtmlFigure>> ite = mrFigures.entrySet().iterator();
    while (ite.hasNext()) {
        Entry<String, SimpleHtmlFigure> entry = ite.next();
        // String key = entry.getKey();
        SimpleHtmlFigure value = entry.getValue();
        if (this.parentMRFigure.getChildren().contains(value)) {
            this.parentMRFigure.remove(value);
        }
    }
}
Also used : Entry(java.util.Map.Entry) SimpleHtmlFigure(org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)

Example 85 with Entry

use of java.util.Map.Entry in project tdi-studio-se by Talend.

the class JobletContainerFigure method initializejobletContainer.

public void initializejobletContainer(Rectangle rectangle) {
    Point location = this.getLocation();
    if (location.equals(lastLocation) && !jobletContainer.getNode().isMapReduceStart() && mrFigures.isEmpty()) {
        // avoid to calculate locations for nothing
        return;
    }
    lastLocation = location;
    collapseFigure.setCollapsed(jobletContainer.isCollapsed());
    collapseFigure.setVisible(this.jobletContainer.getNode().isJoblet());
    //$NON-NLS-1$ //$NON-NLS-2$
    titleFigure.setText("<b> " + title + "</b>");
    Dimension preferedSize = titleFigure.getPreferredSize();
    preferedSize = preferedSize.getExpanded(0, 3);
    collapseFigure.setLocation(new Point(location.x, location.y));
    collapseFigure.setSize(preferedSize.height, preferedSize.height);
    titleFigure.setSize(preferedSize.width, preferedSize.height - 2);
    titleFigure.setLocation(new Point((rectangle.width - preferedSize.width) / 2 + location.x, location.y));
    titleFigure.setVisible(showTitle);
    outlineFigure.setLocation(new Point(location.x, location.y));
    outlineFigure.setVisible(showTitle);
    outlineFigure.setForegroundColor(ColorUtils.getCacheColor(new RGB(220, 120, 120)));
    outlineFigure.setSize(rectangle.width, preferedSize.height);
    refreshMRFigures();
    Iterator<Entry<String, SimpleHtmlFigure>> ite = mrFigures.entrySet().iterator();
    int i = 0;
    while (ite.hasNext()) {
        Entry<String, SimpleHtmlFigure> entry = ite.next();
        String key = entry.getKey();
        SimpleHtmlFigure value = entry.getValue();
        int progressHeight = value.getBounds().height + 3;
        Integer count = this.jobletContainer.getNode().getMrJobInGroupCount();
        i = Integer.parseInt(key.substring(key.indexOf("_") + 1));
        int mry = progressHeight * i;
        int proWidth = value.getBounds().width;
        int jcWidth = this.jobletContainer.getJobletContainerRectangle().width;
        if (isSubjobDisplay) {
            if (!this.jobletContainer.isMRGroupContainesReduce()) {
                if (key.startsWith(KEY_MAP)) {
                    if (jcWidth > proWidth + 12) {
                        value.setLocation(new Point(location.x + jcWidth / 2 - proWidth / 2 - 6, location.y + rectangle.height - count * progressHeight + mry));
                    } else if (jcWidth > proWidth) {
                        value.setLocation(new Point(location.x + jcWidth / 2 - proWidth / 2, location.y + rectangle.height - count * progressHeight + mry));
                    } else {
                        value.setLocation(new Point(location.x, location.y + rectangle.height - count * progressHeight + mry));
                    }
                }
            } else {
                if (jcWidth / 2 >= 120) {
                    if (key.startsWith(KEY_MAP)) {
                        value.setLocation(new Point(location.x + jcWidth / 2 - 120, location.y + rectangle.height - count * progressHeight + mry));
                    }
                    if (key.startsWith(KEY_REDUCE)) {
                        value.setLocation(new Point(location.x + jcWidth / 2, location.y + rectangle.height - count * progressHeight + mry));
                    }
                } else if (jcWidth / 2 > proWidth) {
                    if (key.startsWith(KEY_MAP)) {
                        value.setLocation(new Point(location.x + jcWidth / 2 - proWidth, location.y + rectangle.height - count * progressHeight + mry));
                    }
                    if (key.startsWith(KEY_REDUCE)) {
                        value.setLocation(new Point(location.x + jcWidth / 2, location.y + rectangle.height - count * progressHeight + mry));
                    }
                } else {
                    if (key.startsWith(KEY_MAP)) {
                        value.setLocation(new Point(location.x, location.y + rectangle.height - count * progressHeight + mry));
                    }
                    if (key.startsWith(KEY_REDUCE)) {
                        value.setLocation(new Point(location.x + 110, location.y + rectangle.height - count * progressHeight + mry));
                    }
                }
            }
        }
    }
    rectFig.setLocation(new Point(location.x, /* preferedSize.height + */
    location.y));
    rectFig.setSize(new Dimension(rectangle.width, rectangle.height));
    if (this.jobletContainer.getNode().isJoblet()) {
        if (new JobletUtil().isRed(this.jobletContainer)) {
            if (isSubjobDisplay) {
                rectFig.setBackgroundColor(ColorUtils.getCacheColor(red));
            } else {
                rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
            }
            outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(red));
        } else {
            if (isSubjobDisplay) {
                rectFig.setBackgroundColor(ColorUtils.getCacheColor(green));
            } else {
                rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
            }
            outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(green));
        }
    } else {
        if (isSubjobDisplay) {
            rectFig.setBackgroundColor(ColorUtils.getCacheColor(mrGroupColor));
        } else {
            rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
        }
        outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(mrGroupColor));
        // progressFigure.setBackgroundColor(new Color(Display.getDefault(), red));
        if (!this.jobletContainer.getNode().isMapReduceStart()) {
            rectFig.setVisible(false);
            outlineFigure.setVisible(false);
        }
    }
    if (isSubjobDisplay) {
        if (this.jobletContainer.getNode().isMapReduce()) {
            rectFig.setForegroundColor(ColorUtils.getCacheColor(new RGB(121, 157, 175)));
        } else {
            rectFig.setForegroundColor(ColorUtils.getCacheColor(new RGB(220, 120, 120)));
        }
    } else {
        rectFig.setForegroundColor(ColorUtils.getCacheColor(white));
    }
    markFigure.setSize(errorMarkImage.getImageData().width, errorMarkImage.getImageData().height);
}
Also used : Entry(java.util.Map.Entry) Point(org.eclipse.draw2d.geometry.Point) Dimension(org.eclipse.draw2d.geometry.Dimension) RGB(org.eclipse.swt.graphics.RGB) Point(org.eclipse.draw2d.geometry.Point) SimpleHtmlFigure(org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)

Aggregations

Entry (java.util.Map.Entry)2862 Map (java.util.Map)804 HashMap (java.util.HashMap)786 ArrayList (java.util.ArrayList)749 List (java.util.List)579 IOException (java.io.IOException)314 Iterator (java.util.Iterator)311 Test (org.junit.Test)308 Set (java.util.Set)294 HashSet (java.util.HashSet)271 LinkedHashMap (java.util.LinkedHashMap)194 Collection (java.util.Collection)186 Collectors (java.util.stream.Collectors)179 File (java.io.File)146 TreeMap (java.util.TreeMap)125 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)114 Key (org.apache.accumulo.core.data.Key)112 Value (org.apache.accumulo.core.data.Value)111 Collections (java.util.Collections)104 LinkedList (java.util.LinkedList)103