Package java.util

Examples of java.util.Properties.entrySet()


  //@Override
  public void write(DataOutput out) throws IOException {
    Properties props = getProps();
    WritableUtils.writeVInt(out, props.size());
    for(Map.Entry<Object, Object> item: props.entrySet()) {
      org.apache.hadoop.io.Text.writeString(out, (String) item.getKey());
      org.apache.hadoop.io.Text.writeString(out, (String) item.getValue());
    }
  }
 
View Full Code Here


     *  then this method will put each key-value pairs into log MDC.
     */
    public static void prepareLogContext() {
        Map<String, String> registered = new TreeMap<String, String>();
        Properties properties = System.getProperties();
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            if ((entry.getKey() instanceof String) == false || (entry.getValue() instanceof String) == false) {
                continue;
            }
            String key = (String) entry.getKey();
            if (key.startsWith(LOG_CONTEXT_PREFIX) == false) {
View Full Code Here

        assertNotNull(propertiesProperty);
        assertTrue(propertiesProperty.getValue() instanceof Properties);
        Properties properties = ((Properties)propertiesProperty.getValue());
        assertEquals(1, properties.size());
       
        for(Map.Entry entry : properties.entrySet()) {
            assertEquals("aa", ((TypedStringValue)entry.getKey()).getValue());
            assertEquals("bb", ((TypedStringValue)entry.getValue()).getValue());
        }
    }
   
View Full Code Here

        String batchId = cmd.getOptionValue(OPT_BATCH_ID.getOpt());
        String flowId = cmd.getOptionValue(OPT_FLOW_ID.getOpt());
        Properties arguments = cmd.getOptionProperties(OPT_ARGUMENT.getOpt());

        SortedMap<String, String> pairs = new TreeMap<String, String>();
        for (Map.Entry<Object, Object> entry : arguments.entrySet()) {
            Object key = entry.getKey();
            Object value = entry.getValue();
            if (key instanceof String && value instanceof String) {
                pairs.put((String) key, (String) value);
            }
View Full Code Here

    }

    private static Map<String, String> parseArgs(CommandLine cmd, Option opt) {
        Properties props = cmd.getOptionProperties(opt.getOpt());
        Map<String, String> results = new TreeMap<String, String>();
        for (Map.Entry<Object, Object> entry : props.entrySet()) {
            results.put((String) entry.getKey(), (String) entry.getValue());
        }
        return results;
    }
View Full Code Here

        Properties loadProfile() throws IOException {
            Properties result = load("profile-template.properties");
            result.putAll(override);

            for (Map.Entry<Object, Object> entry : result.entrySet()) {
                String value = (String) entry.getValue();
                StringBuilder buf = new StringBuilder();
                int start = 0;
                Matcher matcher = PLACEHOLDER.matcher(value);
                while (matcher.find(start)) {
View Full Code Here

     *  then this method will put each key-value pairs into log MDC.
     */
    public static void prepareLogContext() {
        Map<String, String> registered = new TreeMap<String, String>();
        Properties properties = System.getProperties();
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            if ((entry.getKey() instanceof String) == false || (entry.getValue() instanceof String) == false) {
                continue;
            }
            String key = (String) entry.getKey();
            if (key.startsWith(LOG_CONTEXT_PREFIX) == false) {
View Full Code Here

        Properties loadProfile() throws IOException {
            Properties result = load("profile-template.properties");
            result.putAll(override);

            for (Map.Entry<Object, Object> entry : result.entrySet()) {
                String value = (String) entry.getValue();
                StringBuilder buf = new StringBuilder();
                int start = 0;
                Matcher matcher = PLACEHOLDER.matcher(value);
                while (matcher.find(start)) {
View Full Code Here

    }

    if (indexProperties) {
      Properties props = docData.getProps();
      if (props != null) {
        for (Iterator iterator = props.entrySet().iterator(); iterator.hasNext();) {
          Entry entry = (Entry) iterator.next();
          Field f = ds.getField((String) entry.getKey(), storeVal, indexVal, termVecVal);
          f.setValue((String) entry.getValue());
          doc.add(f);
        }
View Full Code Here

        // add the env vars to the property set, with the "env." prefix
        // XXX support for env vars should probably be removed from the ModelInterpolator
        try
        {
            Properties envVars = CommandLineUtils.getSystemEnvVars();
            Iterator i = envVars.entrySet().iterator();
            while ( i.hasNext() )
            {
                Entry e = (Entry) i.next();
                executionProperties.setProperty( "env." + e.getKey().toString(), e.getValue().toString() );
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.