@Test(expected = InvalidBinlogException.class) public void filenameCheck2() throws Exception { BinlogInfo.checkFilename("mysql-bin.00001bak"); }
static int checkFilename(String binlogFilename) { try { return Integer.parseInt(binlogFilename.split("\\.")[1]); } catch (NumberFormatException | ArrayIndexOutOfBoundsException e) { throw new InvalidBinlogException(e, binlogFilename, 0); } }
BinlogInfo implements SyncInitMeta<BinlogInfo> { static int checkFilename(String binlogFilename) { try { return Integer.parseInt(binlogFilename.split("\\.")[1]); } catch (NumberFormatException | ArrayIndexOutOfBoundsException e) { throw new InvalidBinlogException(e, binlogFilename, 0); } } }
BinlogInfo implements SyncInitMeta<BinlogInfo> { static int checkFilename(String binlogFilename) { try { return Integer.parseInt(binlogFilename.split("\\.")[1]); } catch (NumberFormatException | ArrayIndexOutOfBoundsException e) { throw new InvalidBinlogException(e, binlogFilename, 0); } } BinlogInfo(String binlogFilename, long binlogPosition); }
BinlogInfo implements SyncInitMeta<BinlogInfo> { static int checkFilename(String binlogFilename) { try { return Integer.parseInt(binlogFilename.split("\\.")[1]); } catch (NumberFormatException | ArrayIndexOutOfBoundsException e) { throw new InvalidBinlogException(e, binlogFilename, 0); } } BinlogInfo(String binlogFilename, long binlogPosition); static BinlogInfo withFilenameCheck(String binlogFilename, long binlogPosition); String getBinlogFilename(); long getBinlogPosition(); @Override int compareTo(BinlogInfo o); @Override String toString(); }
BinlogInfo implements SyncInitMeta<BinlogInfo> { static int checkFilename(String binlogFilename) { try { return Integer.parseInt(binlogFilename.split("\\.")[1]); } catch (NumberFormatException | ArrayIndexOutOfBoundsException e) { throw new InvalidBinlogException(e, binlogFilename, 0); } } BinlogInfo(String binlogFilename, long binlogPosition); static BinlogInfo withFilenameCheck(String binlogFilename, long binlogPosition); String getBinlogFilename(); long getBinlogPosition(); @Override int compareTo(BinlogInfo o); @Override String toString(); static final BinlogInfo latest; static final BinlogInfo earliest; }