下面列出了java.net.URI#compareTo ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
static void cmp0(URI u, URI v, boolean same)
throws URISyntaxException
{
int c = u.compareTo(v);
if ((c == 0) != same)
throw new RuntimeException("Comparison inconsistent: " + u + " " + v
+ " " + c);
}
static void lt(URI u, URI v) throws URISyntaxException {
ne0(u, v);
int c = u.compareTo(v);
if (c >= 0) {
show(u);
show(v);
throw new RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
void moveToDone(final JobID id, boolean sync) {
final List<Path> paths = new ArrayList<Path>();
final Path historyFile = getHistoryFile(id);
if (historyFile == null) {
LOG.info("No file for job-history with " + id + " found in cache!");
} else {
paths.add(historyFile);
}
final Path confPath = getConfFileWriters(id);
if (confPath == null) {
LOG.info("No file for jobconf with " + id + " found in cache!");
} else {
paths.add(confPath);
}
Runnable r = new Runnable() {
public void run() {
//move the files to doneDir folder
try {
List<PrintWriter> writers = getWriters(id);
synchronized (writers) {
while (writers.size() > 0) {
writers.wait();
}
}
URI srcURI = logFs.getUri();
URI doneURI = doneFs.getUri();
boolean useRename = (srcURI.compareTo(doneURI) == 0);
for (Path path : paths) {
//check if path exists, in case of retries it may not exist
if (logFs.exists(path)) {
LOG.info("Moving " + path.toString() + " to " +
doneDir.toString());
Path dstPath = new Path(doneDir, path.getName());
if (useRename) {
doneFs.rename(path, doneDir);
} else {
FileUtil.copy(logFs, path, doneFs, dstPath, true, true, conf);
}
doneFs.setPermission(dstPath,
new FsPermission(HISTORY_FILE_PERMISSION));
}
}
} catch (Throwable e) {
LOG.error("Unable to move history file to DONE folder:\n"
+ StringUtils.stringifyException(e));
}
String historyFileDonePath = null;
if (historyFile != null) {
historyFileDonePath = new Path(doneDir,
historyFile.getName()).toString();
}
jobHistoryFileMap.put(id, new MovedFileInfo(historyFileDonePath,
System.currentTimeMillis()));
jobTracker.historyFileCopied(id, historyFileDonePath);
//purge the job from the cache
purgeJob(id);
}
};
if (sync) {
r.run();
} else {
executor.execute(r);
}
}