/**@brief revoke function called by storage server to invalidate * libstore cache entry * @param RevokeLeaseArgs * @param RevokeLeaseReply * @return error */ func (ls *Libstore) RevokeLease( args *storageproto.RevokeLeaseArgs, reply *storageproto.RevokeLeaseReply) error { var valid bool //fmt.Printf("libstore Revoking lease: %s\n", args.Key) valid = ls.Leases.ClearEntry(args.Key) if !valid { reply.Status = storageproto.EKEYNOTFOUND } else { reply.Status = storageproto.OK } return nil }
// Make StorageTester CacheRPC-able func (st *StorageTester) RevokeLease(args *storageproto.RevokeLeaseArgs, reply *storageproto.RevokeLeaseReply) error { //fmt.Printf("Revoke Msg received %s\n", args.Key) st.recv_revoke[args.Key] = true st.comp_revoke[args.Key] = false time.Sleep(time.Duration(st.delay*1000) * time.Millisecond) st.comp_revoke[args.Key] = true reply.Status = storageproto.OK return nil }
func (ls *Libstore) RevokeLease(args *storageproto.RevokeLeaseArgs, reply *storageproto.RevokeLeaseReply) error { lsplog.Vlogf(1, "[RevokeLease] Revoking lease for %s", args.Key) delete(ls.cache, args.Key) reply.Status = storageproto.OK return nil }
func (ls *Libstore) RevokeLease(args *storageproto.RevokeLeaseArgs, reply *storageproto.RevokeLeaseReply) error { ls.ClearCaches(args.Key) reply.Status = storageproto.OK return nil }