一直用JAVA讀寫memcached沒出問題
今天與PHP系統對接的時候,一直取不到PHP儲存的元素,但是PHP又取得到JAVA這邊儲存的元素。
最後裝了MemAdmin,查看了一下,PHP儲存的元素的Flags全是0,而java使用類別庫儲存的字元型的Flags是32。讓PHP修改下儲存的Flags後問題解決。
附帶下幾種類型的Flags:
Java代碼
public static final int MARKER_BYTE = 1; public static final int MARKER_BOOLEAN = 8192; public static final int MARKER_INTEGER = 4; public static final int MARKER_LONG = 16384; public static final int MARKER_CHARACTER = 16; public static final int MARKER_STRING = 32; public static final int MARKER_STRINGBUFFER = 64; public static final int MARKER_FLOAT = 128; public static final int MARKER_SHORT = 256; public static final int MARKER_DOUBLE = 512; public static final int MARKER_DATE = 1024; public static final int MARKER_STRINGBUILDER = 2048; public static final int MARKER_BYTEARR = 4096;