Writerを更新する。更新失敗した場合は50回までリトライを行う。
517207
public void updateWriter()
    {
        HdfsStreamWriter result = new HdfsStreamWriter();
        String suffix = this.config.getTmpFileSuffix();
        int suffixIndex = 0;
        boolean isFileSyncEachTime = this.config.isFileSyncEachTime();
        boolean isSucceed = false;

        while (suffixIndex < TMP_MAX)
        {
            try
            {
                result.open(this.currentOutputUri + suffix, this.fileSystem, isFileSyncEachTime);
                isSucceed = true;
                break;
            }
            catch (IOException ex)
            {
                String logFormat = "Failed to HDFS file open. Skip and retry next file. : TargetUri={0}";
                String logMessage = MessageFormat.format(logFormat, this.currentOutputUri + suffix);
                logger.warn(logMessage, ex);
                suffixIndex++;
                suffix = this.config.getTmpFileSuffix() + suffixIndex;
            }
        }

        if (isSucceed)
        {
            this.currentWriter = result;
            this.currentSuffix = suffix;
        }
        else
        {
            String logFormat = "HDFS file open failure is retry overed. Skip HDFS file open. : TargetUri={0}";
            String logMessage = MessageFormat.format(logFormat, this.currentOutputUri + suffix);
            logger.warn(logMessage);
        }
    }
1074485
public static void write(BufferedWriter writer, DatabaseFieldConfig config, String tableName) throws SQLException {
		try {
			writeConfig(writer, config, tableName);
		} catch (IOException e) {
			throw SqlExceptionUtil.create("Could not write config to writer", e);
		}
	}
1314845
public void write(Writer writer, long start) throws IOException {
        // Extract rules applicable to dates after the start time
        TimeZoneRule[] rules = tz.getTimeZoneRules(start);

        // Create a RuleBasedTimeZone with the subset rule
        RuleBasedTimeZone rbtz = new RuleBasedTimeZone(tz.getID(), (InitialTimeZoneRule)rules[0]);
        for (int i = 1; i < rules.length; i++) {
            rbtz.addTransitionRule(rules[i]);
        }
        String[] customProperties = null;
        if (olsonzid != null && ICU_TZVERSION != null) {
            customProperties = new String[1];
            customProperties[0] = ICU_TZINFO_PROP + COLON + olsonzid + "[" + ICU_TZVERSION + 
                "/Partial@" + start + "]";
        }
        writeZone(writer, rbtz, customProperties);
    }
605544
public function onAfterWrite()
    {
        $instance = $this->getWorkflowInstance();
        if ($instance && $instance->CurrentActionID) {
            $action = $instance->CurrentAction()->BaseAction()->targetUpdated($instance);
        }
    }
665211
public void setOutput(java.io.Writer writer) {
        
        fOut = writer instanceof PrintWriter
                ? (PrintWriter)writer : new PrintWriter(writer);
        
    }
1052570
private function write($data){
		// var_dump($data);
		if( $this->action_name == "create" ){
			$result = $this->exdb->insert(
				$this->table_name,
				$data
			);
		}elseif( $this->action_name == "edit" ){
			$result = $this->exdb->update(
				$this->table_name,
				array($this->table_definition->key_column=>$this->row_id),
				$data
			);
		}

		if( !$result ){
			// 書き込みに失敗
			$errors = array();
			$errors[':common'] = 'Sorry, failed to save changes. Please try again later.';
			return $this->input($data, $errors);
		}

		if( !is_null( @$data[$this->table_definition->key_column] ) ){
			// キーの値を変更している場合は更新する
			$this->row_id = $data[$this->table_definition->key_column];
		}

		$action = '';
		@header('Location: '.$action.'?'.urlencode(':action').'=done');
		return '';
	}
626062
public final void increaseWrittenBytes(int increment, long currentTime) {
        if (increment <= 0) {
            return;
        }

        writtenBytes += increment;
        lastWriteTime = currentTime;
        idleCountForBoth.set(0);
        idleCountForWrite.set(0);

        if (getService() instanceof AbstractIoService) {
            getService().getStatistics().increaseWrittenBytes(increment, currentTime);
        }

        increaseScheduledWriteBytes(-increment);
    }
61444
public void insertNewRow() {

        // reset all fields
        for (int i = 0; i < komponente.length; i++) {
            komponente[i].clearContent();
        }    // end of for (int i=0; i<komponente.length; i++)

        // reset the field for the primary keys
        for (int i = 0; i < primaryKeys.length; i++) {
            komponente[pkColIndex[i]].setEditable(true);
        }

        ZaurusEditor.printStatus("enter a new row for table " + tableName);
    }
387898
private synchronized void rewriteFile() throws FileNotFoundException, IOException {
        JsonArrayBuilder jsonToStore = Json.createArrayBuilder();

        // Iterate through the assets in id order
        Map<String, JsonObject> assetMap = assets == null ? Collections.<String, JsonObject> emptyMap() : assets;
        for (int i = 1; i < idCounter.get(); i++) {
            JsonObject json = assetMap.get(Integer.toString(i));
            if (json == null) {
                jsonToStore.addNull();
            } else {
                jsonToStore.add(json);
            }
        }
        // Write the assets back to the file
        Map<String, Object> config = new HashMap<String, Object>();
        config.put(JsonGenerator.PRETTY_PRINTING, true);
        JsonWriterFactory writerFactory = Json.createWriterFactory(config);
        try (FileOutputStream out = new FileOutputStream(file);
                        JsonWriter streamWriter = writerFactory.createWriter(out)) {
            streamWriter.write(jsonToStore.build());
        }
    }
764558
void refreshAfterWrite(String key, @Nullable String value) {
    requireArgument(refreshAfterWriteDuration == UNSET_INT, "refreshAfterWrite was already set");
    refreshAfterWriteDuration = parseDuration(key, value);
    refreshAfterWriteTimeUnit = parseTimeUnit(key, value);
  }
697242
public void write(BufferedWriter writer) throws Exception {
		Enumeration enm;

		// header
		writer.write("# generated " + new Date());
		writer.newLine();

		enm = elements();

		while (enm.hasMoreElements()) {
			writer.write(enm.nextElement().toString());
			writer.newLine();
		}

		writer.flush();
		writer.close();
	}
1122334
public Writer write(Writer writer) throws JSONException {
        try {
            if (m_map.isEmpty()) {
                writer.write("{}");
                return writer;
            }
            // This prefix value applies to the first key only
            String keyprefix = "{\"";
            for (Entry<String, Object> entry : m_map.entrySet()) {
                writer.write(keyprefix);
                writer.write(quotable(entry.getKey()));
                writer.write("\":");
                Object v = entry.getValue();
                if (v instanceof JSONObject) {
                    ((JSONObject)v).write(writer);
                }
                else if (v instanceof JSONArray) {
                    ((JSONArray)v).write(writer);
                }
                else {
                    writer.write(valueToString(v));
                }
                // This prefix value applies to all subsequent keys
                keyprefix = ",\"";
            }
            writer.write('}');
            return writer;
        }
        catch (IOException exception) {
            throw new JSONException(exception);
        }
     }
833975
public void ready() {
        
        // 複数の文字の場合、重複を排除する。
        final Set<String> duplicatedWords = new HashSet<>();
        final List<MultiChar> newMulti = new ArrayList<>();
        for(MultiChar word : multi) {
            if(duplicatedWords.contains(word.word)) {
                continue;
            }
            duplicatedWords.add(word.word);
            newMulti.add(word);
        }
        
        // 複数の文字の場合、文字長が長い順に並び替える。
        Collections.sort(newMulti, new Comparator<MultiChar>() {
            
            @Override
            public int compare(final MultiChar o1, final MultiChar o2) {
                
                final int length1 = o1.word.length();
                final int length2 = o2.word.length();
                if(length1 < length2) {
                    return 1;
                    
                } else if(length1 > length2) {
                    return -1;
                    
                } else {
                    return o1.word.compareTo(o2.word);
                }
            }
        });
        
        multi.clear();
        multi.addAll(newMulti);
        
    }
526781
function (/* arguments */) { var args = arguments
        log.withWriteBackend (
            log.impl.defaultWriteBackend,
            function (done) {
                log.write.apply (null, args); done () }) }
256757
private synchronized void updateBytesWrittenMeter() {
    if (this.bytesWrittenMeter.isPresent()) {
      try {
        this.bytesWrittenMeter.get().mark(bytesWritten() - this.bytesWrittenMeter.get().getCount());
      } catch (IOException e) {
        log.error("Cannot get bytesWritten for DataWriter, will not update " + this.bytesWrittenMeter.get().toString(),
            e);
      }
    }
  }
880552
public void dump(Writer writer) {
        PrintWriter printer = new PrintWriter(writer);
        for (String sectionType : sectionsByType.keySet()) {
            int sectionNumber = 0;
            for (Section section : sectionsByType.get(sectionType)) {
                printer.printf("%s [%d]%n", sectionType, sectionNumber++);
                for (String key : section) {
                    printer.printf(" %30s -> %s%n", key, section.value(key));
                }
            }
            printer.println();
        }
        try {
            writer.flush();
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
28966
protected static final Writer writeValue(Writer writer, Object value, int indentFactor, int indent, JSONConfig config) throws JSONException, IOException {
		if (value == null || value instanceof JSONNull) {
			writer.write(JSONNull.NULL.toString());
		} else if (value instanceof JSON) {
			((JSON) value).write(writer, indentFactor, indent);
		} else if (value instanceof Map) {
			new JSONObject((Map<?, ?>) value).write(writer, indentFactor, indent);
		} else if (value instanceof Iterable || value instanceof Iterator || value.getClass().isArray()) {
			new JSONArray(value).write(writer, indentFactor, indent);
		} else if (value instanceof Number) {
			writer.write(NumberUtil.toStr((Number) value));
		} else if (value instanceof Date || value instanceof Calendar) {
			final String format = (null == config) ? null : config.getDateFormat();
			writer.write(formatDate(value, format));
		} else if (value instanceof Boolean) {
			writer.write(value.toString());
		} else if (value instanceof JSONString) {
			Object o;
			try {
				o = ((JSONString) value).toJSONString();
			} catch (Exception e) {
				throw new JSONException(e);
			}
			writer.write(o != null ? o.toString() : JSONUtil.quote(value.toString()));
		} else {
			JSONUtil.quote(value.toString(), writer);
		}
		return writer;
	}