|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2010-2011 the original author or authors. |
|
|
|
* Copyright 2010-2015 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -17,13 +17,10 @@ package org.springframework.data.mongodb.core.mapreduce; |
|
|
|
|
|
|
|
|
|
|
|
public class MapReduceTiming { |
|
|
|
public class MapReduceTiming { |
|
|
|
|
|
|
|
|
|
|
|
private long mapTime; |
|
|
|
private long mapTime, emitLoopTime, totalTime; |
|
|
|
|
|
|
|
|
|
|
|
private long emitLoopTime; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private long totalTime; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public MapReduceTiming(long mapTime, long emitLoopTime, long totalTime) { |
|
|
|
public MapReduceTiming(long mapTime, long emitLoopTime, long totalTime) { |
|
|
|
|
|
|
|
|
|
|
|
this.mapTime = mapTime; |
|
|
|
this.mapTime = mapTime; |
|
|
|
this.emitLoopTime = emitLoopTime; |
|
|
|
this.emitLoopTime = emitLoopTime; |
|
|
|
this.totalTime = totalTime; |
|
|
|
this.totalTime = totalTime; |
|
|
|
@ -41,37 +38,52 @@ public class MapReduceTiming { |
|
|
|
return totalTime; |
|
|
|
return totalTime; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* (non-Javadoc) |
|
|
|
|
|
|
|
* @see java.lang.Object#toString() |
|
|
|
|
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
public String toString() { |
|
|
|
return "MapReduceTiming [mapTime=" + mapTime + ", emitLoopTime=" + emitLoopTime + ", totalTime=" + totalTime + "]"; |
|
|
|
return "MapReduceTiming [mapTime=" + mapTime + ", emitLoopTime=" + emitLoopTime + ", totalTime=" + totalTime + "]"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* (non-Javadoc) |
|
|
|
|
|
|
|
* @see java.lang.Object#hashCode() |
|
|
|
|
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int hashCode() { |
|
|
|
public int hashCode() { |
|
|
|
|
|
|
|
|
|
|
|
final int prime = 31; |
|
|
|
final int prime = 31; |
|
|
|
int result = 1; |
|
|
|
int result = 1; |
|
|
|
|
|
|
|
|
|
|
|
result = prime * result + (int) (emitLoopTime ^ (emitLoopTime >>> 32)); |
|
|
|
result = prime * result + (int) (emitLoopTime ^ (emitLoopTime >>> 32)); |
|
|
|
result = prime * result + (int) (mapTime ^ (mapTime >>> 32)); |
|
|
|
result = prime * result + (int) (mapTime ^ (mapTime >>> 32)); |
|
|
|
result = prime * result + (int) (totalTime ^ (totalTime >>> 32)); |
|
|
|
result = prime * result + (int) (totalTime ^ (totalTime >>> 32)); |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* (non-Javadoc) |
|
|
|
|
|
|
|
* @see java.lang.Object#equals(java.lang.Object) |
|
|
|
|
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean equals(Object obj) { |
|
|
|
public boolean equals(Object obj) { |
|
|
|
if (this == obj) |
|
|
|
|
|
|
|
|
|
|
|
if (this == obj) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
if (obj == null) |
|
|
|
} |
|
|
|
return false; |
|
|
|
|
|
|
|
if (getClass() != obj.getClass()) |
|
|
|
if (!(obj instanceof MapReduceTiming)) { |
|
|
|
return false; |
|
|
|
|
|
|
|
MapReduceTiming other = (MapReduceTiming) obj; |
|
|
|
|
|
|
|
if (emitLoopTime != other.emitLoopTime) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
if (mapTime != other.mapTime) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
if (totalTime != other.totalTime) |
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MapReduceTiming that = (MapReduceTiming) obj; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.emitLoopTime == that.emitLoopTime && //
|
|
|
|
|
|
|
|
this.mapTime == that.mapTime && //
|
|
|
|
|
|
|
|
this.totalTime == that.totalTime; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|